httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From traw...@apache.org
Subject svn commit: r983065 - in /httpd/httpd/trunk: modules/dav/fs/ modules/filters/ modules/generators/ modules/http/ modules/mappers/ modules/metadata/ modules/proxy/ modules/test/ server/
Date Fri, 06 Aug 2010 17:36:53 GMT
Author: trawick
Date: Fri Aug  6 17:36:52 2010
New Revision: 983065

URL: http://svn.apache.org/viewvc?rev=983065&view=rev
Log:
Intel's compiler warns about assigning the non-enum value 0 to the 
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.


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

Modified: httpd/httpd/trunk/modules/dav/fs/repos.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/dav/fs/repos.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/dav/fs/repos.c (original)
+++ httpd/httpd/trunk/modules/dav/fs/repos.c Fri Aug  6 17:36:52 2010
@@ -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 
     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,

Modified: httpd/httpd/trunk/modules/filters/mod_include.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/filters/mod_include.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/filters/mod_include.c (original)
+++ httpd/httpd/trunk/modules/filters/mod_include.c Fri Aug  6 17:36:52 2010
@@ -973,7 +973,7 @@ static int find_file(request_rec *r, con
                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, con
            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);

Modified: httpd/httpd/trunk/modules/generators/mod_asis.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_asis.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_asis.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_asis.c Fri Aug  6 17:36:52 2010
@@ -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;

Modified: httpd/httpd/trunk/modules/generators/mod_cgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgi.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgi.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgi.c Fri Aug  6 17:36:52 2010
@@ -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)

Modified: httpd/httpd/trunk/modules/generators/mod_cgid.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/generators/mod_cgid.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/generators/mod_cgid.c (original)
+++ httpd/httpd/trunk/modules/generators/mod_cgid.c Fri Aug  6 17:36:52 2010
@@ -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

Modified: httpd/httpd/trunk/modules/http/http_etag.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/http/http_etag.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/http/http_etag.c (original)
+++ httpd/httpd/trunk/modules/http/http_etag.c Fri Aug  6 17:36:52 2010
@@ -109,7 +109,7 @@ AP_DECLARE(char *) ap_make_etag(request_
         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.

Modified: httpd/httpd/trunk/modules/mappers/mod_actions.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_actions.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_actions.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_actions.c Fri Aug  6 17:36:52 2010
@@ -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;

Modified: httpd/httpd/trunk/modules/mappers/mod_speling.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/mappers/mod_speling.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/mappers/mod_speling.c (original)
+++ httpd/httpd/trunk/modules/mappers/mod_speling.c Fri Aug  6 17:36:52 2010
@@ -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;
     }
 

Modified: httpd/httpd/trunk/modules/metadata/mod_cern_meta.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_cern_meta.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_cern_meta.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_cern_meta.c Fri Aug  6 17:36:52 2010
@@ -285,7 +285,7 @@ static int add_cern_meta_data(request_re
 
     /* if ./.web/$1.meta exists then output 'asis' */
 
-    if (r->finfo.filetype == 0) {
+    if (r->finfo.filetype == APR_NOFILE) {
         return DECLINED;
     };
 

Modified: httpd/httpd/trunk/modules/metadata/mod_expires.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_expires.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_expires.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_expires.c Fri Aug  6 17:36:52 2010
@@ -402,7 +402,7 @@ static int set_expiration_fields(request
 
     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.
              */

Modified: httpd/httpd/trunk/modules/metadata/mod_mime_magic.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/metadata/mod_mime_magic.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/metadata/mod_mime_magic.c (original)
+++ httpd/httpd/trunk/modules/metadata/mod_mime_magic.c Fri Aug  6 17:36:52 2010
@@ -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;
     }
 

Modified: httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c (original)
+++ httpd/httpd/trunk/modules/proxy/mod_proxy_scgi.c Fri Aug  6 17:36:52 2010
@@ -463,7 +463,7 @@ static int scgi_request_status(int *stat
 
                 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).

Modified: httpd/httpd/trunk/modules/test/mod_dialup.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/test/mod_dialup.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/test/mod_dialup.c (original)
+++ httpd/httpd/trunk/modules/test/mod_dialup.c Fri Aug  6 17:36:52 2010
@@ -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;
     }

Modified: httpd/httpd/trunk/server/core.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/core.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/server/core.c (original)
+++ httpd/httpd/trunk/server/core.c Fri Aug  6 17:36:52 2010
@@ -3495,7 +3495,7 @@ static int default_handler(request_rec *
     }
 
     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;

Modified: httpd/httpd/trunk/server/request.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/server/request.c?rev=983065&r1=983064&r2=983065&view=diff
==============================================================================
--- httpd/httpd/trunk/server/request.c (original)
+++ httpd/httpd/trunk/server/request.c Fri Aug  6 17:36:52 2010
@@ -578,7 +578,7 @@ AP_DECLARE(int) ap_directory_walk(reques
      * 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(reques
          * 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(reques
              * 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(reques
         /* 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_loo
             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_loo
                                 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_loo
             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_loo
                                 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_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) {



Mime
View raw message