]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Intel's compiler warns about assigning the non-enum value 0 to the
authorJeff Trawick <trawick@apache.org>
Fri, 6 Aug 2010 17:36:52 +0000 (17:36 +0000)
committerJeff Trawick <trawick@apache.org>
Fri, 6 Aug 2010 17:36:52 +0000 (17:36 +0000)
enumeration apr_finfo_t.filetype, which is done when forgetting
the previously-derived file type

use the appropriate enum value APR_NOFILE instead

Also change comparisons of the field with 0 to use APR_NOFILE instead,
as is the practice of some existing code.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983065 13f79535-47bb-0310-9956-ffa450edef68

15 files changed:
modules/dav/fs/repos.c
modules/filters/mod_include.c
modules/generators/mod_asis.c
modules/generators/mod_cgi.c
modules/generators/mod_cgid.c
modules/http/http_etag.c
modules/mappers/mod_actions.c
modules/mappers/mod_speling.c
modules/metadata/mod_cern_meta.c
modules/metadata/mod_expires.c
modules/metadata/mod_mime_magic.c
modules/proxy/mod_proxy_scgi.c
modules/test/mod_dialup.c
server/core.c
server/request.c

index b178992891e02971aca2ce644995e595d8ea332c..91c9d63afbc27319f7da73a5849ed2adef090b7b 100644 (file)
@@ -728,7 +728,7 @@ static dav_error * dav_fs_get_resource(
         resource->uri = r->uri;
     }
 
-    if (r->finfo.filetype != 0) {
+    if (r->finfo.filetype != APR_NOFILE) {
         resource->exists = 1;
         resource->collection = r->finfo.filetype == APR_DIR;
 
@@ -762,7 +762,7 @@ static dav_error * dav_fs_get_resource(
 
             /* retain proper integrity across the structures */
             if (!resource->exists) {
-                ctx->finfo.filetype = 0;
+                ctx->finfo.filetype = APR_NOFILE;
             }
         }
     }
@@ -847,7 +847,7 @@ static int dav_fs_is_same_resource(
     if (res1->hooks != res2->hooks)
         return 0;
 
-    if ((ctx1->finfo.filetype != 0) && (ctx2->finfo.filetype != 0)
+    if ((ctx1->finfo.filetype != APR_NOFILE) && (ctx2->finfo.filetype != APR_NOFILE)
         && (ctx1->finfo.valid & ctx2->finfo.valid & APR_FINFO_INODE)) {
         return ctx1->finfo.inode == ctx2->finfo.inode;
     }
@@ -1865,7 +1865,7 @@ static const char *dav_fs_getetag(const dav_resource *resource)
     if (!resource->exists)
         return apr_pstrdup(ctx->pool, "");
 
-    if (ctx->finfo.filetype != 0) {
+    if (ctx->finfo.filetype != APR_NOFILE) {
         return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%"
                             APR_UINT64_T_HEX_FMT "-%" APR_UINT64_T_HEX_FMT "\"",
                             (apr_uint64_t) ctx->finfo.inode,
index 3921787633e659f11739f4c23b098ce35a2fc077..6c12586961fe1de1b249601b7f22e312f6999a68 100644 (file)
@@ -973,7 +973,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
                we never attempt to "run" this sub request. */
             rr = ap_sub_req_lookup_file(newpath, r, NULL);
 
-            if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+            if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
                 to_send = rr->filename;
                 if ((rv = apr_stat(finfo, to_send,
                     APR_FINFO_GPROT | APR_FINFO_MIN, rr->pool)) != APR_SUCCESS
@@ -1003,7 +1003,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
            we never attempt to "run" this sub request. */
         rr = ap_sub_req_lookup_uri(tag_val, r, NULL);
 
-        if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+        if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
             memcpy((char *) finfo, (const char *) &rr->finfo,
                    sizeof(rr->finfo));
             ap_destroy_sub_req(rr);
index 7fe634e97b24f33c0a6c2afdf2002707592e968e..c67650393fc418cdbcfb3ad8f9fb9bd4852cef7c 100644 (file)
@@ -41,7 +41,7 @@ static int asis_handler(request_rec *r)
     r->allowed |= (AP_METHOD_BIT << M_GET);
     if (r->method_number != M_GET)
         return DECLINED;
-    if (r->finfo.filetype == 0) {
+    if (r->finfo.filetype == APR_NOFILE) {
         ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                     "File does not exist: %s", r->filename);
         return HTTP_NOT_FOUND;
index 25901fdd1660e16a79ad09dd9844fbfe22eccaf9..3dfddd96f2d06e72e2061a8b8efb2b39adfc47e9 100644 (file)
@@ -775,7 +775,7 @@ static int cgi_handler(request_rec *r)
         return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
                                "attempt to include NPH CGI script");
 
-    if (r->finfo.filetype == 0)
+    if (r->finfo.filetype == APR_NOFILE)
         return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
                                "script not found or unable to stat");
     if (r->finfo.filetype == APR_DIR)
index 6e6fc0ca7f0a0177af9702c2904134c4d75da898..56bc579266ce3f0bc54dc18c17267e89277fef0f 100644 (file)
@@ -1373,7 +1373,7 @@ static int cgid_handler(request_rec *r)
 #error mod_cgid does not work on this platform.  If you teach it to, look
 #error at mod_cgi.c for required code in this path.
 #else
-    if (r->finfo.filetype == 0)
+    if (r->finfo.filetype == APR_NOFILE)
         return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
                                "script not found or unable to stat");
 #endif
index 9148ae475f8726e6f18c3418a5afcf5b64cb35ee..a04dbea7ce2d816d3c4c440da4eb798b51aa2a3e 100644 (file)
@@ -109,7 +109,7 @@ AP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak)
         weak_len = sizeof(ETAG_WEAK);
     }
 
-    if (r->finfo.filetype != 0) {
+    if (r->finfo.filetype != APR_NOFILE) {
         /*
          * ETag gets set to [W/]"inode-size-mtime", modulo any
          * FileETag keywords.
index 66ebeae64d515a4b4d457ce64bf4890041c65d84..9d9faaac197a687d6fcf2c7ab4ff47bd75a95a65 100644 (file)
@@ -180,7 +180,7 @@ static int action_handler(request_rec *r)
         ap_field_noparam(r->pool, r->content_type);
 
     if (action && (t = apr_table_get(conf->action_types, action))) {
-        if (*t++ == '0' && r->finfo.filetype == 0) {
+        if (*t++ == '0' && r->finfo.filetype == APR_NOFILE) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "File does not exist: %s", r->filename);
             return HTTP_NOT_FOUND;
index 8288af7520feb8d28d6f888900aa7567e773e7e0..4fad5aa040261b72e22c4f9e6c26917684d088ac 100644 (file)
@@ -211,7 +211,7 @@ static int check_speling(request_rec *r)
     }
 
     /* We've already got a file of some kind or another */
-    if (r->finfo.filetype != 0) {
+    if (r->finfo.filetype != APR_NOFILE) {
         return DECLINED;
     }
 
index f80f36b47abdf0b9bf638a2f63b9630eca0ff64f..e37891a3d9ff39af58150a94da1ab194f884a9b5 100644 (file)
@@ -285,7 +285,7 @@ static int add_cern_meta_data(request_rec *r)
 
     /* if ./.web/$1.meta exists then output 'asis' */
 
-    if (r->finfo.filetype == 0) {
+    if (r->finfo.filetype == APR_NOFILE) {
         return DECLINED;
     };
 
index ac2dfad742adef6253f57bdb70f2a7d61564b52d..ebf02c8b8bb07af82837deddf1bbc74b1fb70e91 100644 (file)
@@ -402,7 +402,7 @@ static int set_expiration_fields(request_rec *r, const char *code,
 
     switch (code[0]) {
     case 'M':
-        if (r->finfo.filetype == 0) {
+        if (r->finfo.filetype == APR_NOFILE) {
             /* file doesn't exist on disk, so we can't do anything based on
              * modification time.  Note that this does _not_ log an error.
              */
index f9ef86f7ce22eadbcb82e14ff67f48ecf8e07617..7d17ede3370f511cedb5603ef49cb34ba0239104 100644 (file)
@@ -2417,7 +2417,7 @@ static int magic_find_ct(request_rec *r)
     magic_server_config_rec *conf;
 
     /* the file has to exist */
-    if (r->finfo.filetype == 0 || !r->filename) {
+    if (r->finfo.filetype == APR_NOFILE || !r->filename) {
         return DECLINED;
     }
 
index 58f5b0823b610c16ca289d3eaa429d1070ddf16d..d99a3ba5eda23d83cbb9c213a3f30c67cc8e0060 100644 (file)
@@ -463,7 +463,7 @@ static int scgi_request_status(int *status, request_rec *r)
 
                 rr = ap_sub_req_lookup_file(req_conf->location, r,
                                             r->output_filters);
-                if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
+                if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
                     /*
                      * We don't touch Content-Length here. It might be
                      * borked (there's plenty of room for a race condition).
index 2785698d81f14d5c34defee157d07e64e737cece..638600698fa07a796b77bc8275ee550f8762263a 100644 (file)
@@ -143,7 +143,7 @@ dialup_handler(request_rec *r)
 
     /* See core.c, default handler for all of the cases we just decline. */
     if (r->method_number != M_GET || 
-        r->finfo.filetype == 0 || 
+        r->finfo.filetype == APR_NOFILE || 
         r->finfo.filetype == APR_DIR) {
         return DECLINED;
     }
index 98a183bf2fd45eab2836655b3fd11e56d459dd5b..5bd4ac3376b6850d3d0666cbd86a9c55238b3d71 100644 (file)
@@ -3495,7 +3495,7 @@ static int default_handler(request_rec *r)
     }
 
     if (r->method_number == M_GET || r->method_number == M_POST) {
-        if (r->finfo.filetype == 0) {
+        if (r->finfo.filetype == APR_NOFILE) {
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "File does not exist: %s", r->filename);
             return HTTP_NOT_FOUND;
index 494099a392b5848181ac6b812bf430ce320c3430..92f989b6aa89fd87bb89b5ae0d13006e517a002e 100644 (file)
@@ -578,7 +578,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
      * types of failure, such as APR_ENOTDIR.  We can do something
      * with APR_ENOENT, knowing that the path is good.
      */
-    if (!r->finfo.filetype || r->finfo.filetype == APR_LNK) {
+    if (r->finfo.filetype == APR_NOFILE || r->finfo.filetype == APR_LNK) {
         rv = apr_stat(&r->finfo, r->filename, APR_FINFO_MIN, r->pool);
 
         /* some OSs will return APR_SUCCESS/APR_REG if we stat
@@ -592,10 +592,10 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
          * Also reset if the stat failed, just for safety.
          */
         if ((rv != APR_SUCCESS) ||
-            (r->finfo.filetype &&
+            (r->finfo.filetype != APR_NOFILE &&
              (r->finfo.filetype != APR_DIR) &&
              (r->filename[strlen(r->filename) - 1] == '/'))) {
-             r->finfo.filetype = 0; /* forget what we learned */
+             r->finfo.filetype = APR_NOFILE; /* forget what we learned */
         }
     }
 
@@ -1041,7 +1041,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
              * if...we have allowed symlinks
              * skip the lstat and dummy up an APR_DIR value for thisinfo.
              */
-            if (r->finfo.filetype
+            if (r->finfo.filetype != APR_NOFILE
 #ifdef CASE_BLIND_FILESYSTEM
                 && (filename_len <= canonical_len)
 #endif
@@ -1133,7 +1133,7 @@ AP_DECLARE(int) ap_directory_walk(request_rec *r)
         /* If we have _not_ optimized, this is the time to recover
          * the final stat result.
          */
-        if (!r->finfo.filetype || r->finfo.filetype == APR_LNK) {
+        if (r->finfo.filetype == APR_NOFILE || r->finfo.filetype == APR_LNK) {
             r->finfo = thisinfo;
         }
 
@@ -1966,7 +1966,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
             if (((rv = apr_stat(&rnew->finfo, rnew->filename,
                                 APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
-                rnew->finfo.filetype = 0;
+                rnew->finfo.filetype = APR_NOFILE;
             }
         }
         else {
@@ -1974,7 +1974,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_dirent(const apr_finfo_t *dirent,
                                 APR_FINFO_LINK | APR_FINFO_MIN,
                                 rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
-                rnew->finfo.filetype = 0;
+                rnew->finfo.filetype = APR_NOFILE;
             }
         }
     }
@@ -2072,7 +2072,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
             if (((rv = apr_stat(&rnew->finfo, rnew->filename,
                                 APR_FINFO_MIN, rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
-                rnew->finfo.filetype = 0;
+                rnew->finfo.filetype = APR_NOFILE;
             }
         }
         else {
@@ -2080,7 +2080,7 @@ AP_DECLARE(request_rec *) ap_sub_req_lookup_file(const char *new_file,
                                 APR_FINFO_LINK | APR_FINFO_MIN,
                                 rnew->pool)) != APR_SUCCESS)
                 && (rv != APR_INCOMPLETE)) {
-                rnew->finfo.filetype = 0;
+                rnew->finfo.filetype = APR_NOFILE;
             }
         }
 
@@ -2129,7 +2129,7 @@ AP_DECLARE(int) ap_run_sub_req(request_rec *r)
     /* Run the quick handler if the subrequest is not a dirent or file
      * subrequest
      */
-    if (!(r->filename && r->finfo.filetype)) {
+    if (!(r->filename && r->finfo.filetype != APR_NOFILE)) {
         retval = ap_run_quick_handler(r, 0);
     }
     if (retval != OK) {