Skip to content

Commit f32e0cc

Browse files
committed
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. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@983065 13f79535-47bb-0310-9956-ffa450edef68
1 parent d87e476 commit f32e0cc

15 files changed

Lines changed: 28 additions & 28 deletions

File tree

modules/dav/fs/repos.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ static dav_error * dav_fs_get_resource(
728728
resource->uri = r->uri;
729729
}
730730

731-
if (r->finfo.filetype != 0) {
731+
if (r->finfo.filetype != APR_NOFILE) {
732732
resource->exists = 1;
733733
resource->collection = r->finfo.filetype == APR_DIR;
734734

@@ -762,7 +762,7 @@ static dav_error * dav_fs_get_resource(
762762

763763
/* retain proper integrity across the structures */
764764
if (!resource->exists) {
765-
ctx->finfo.filetype = 0;
765+
ctx->finfo.filetype = APR_NOFILE;
766766
}
767767
}
768768
}
@@ -847,7 +847,7 @@ static int dav_fs_is_same_resource(
847847
if (res1->hooks != res2->hooks)
848848
return 0;
849849

850-
if ((ctx1->finfo.filetype != 0) && (ctx2->finfo.filetype != 0)
850+
if ((ctx1->finfo.filetype != APR_NOFILE) && (ctx2->finfo.filetype != APR_NOFILE)
851851
&& (ctx1->finfo.valid & ctx2->finfo.valid & APR_FINFO_INODE)) {
852852
return ctx1->finfo.inode == ctx2->finfo.inode;
853853
}
@@ -1865,7 +1865,7 @@ static const char *dav_fs_getetag(const dav_resource *resource)
18651865
if (!resource->exists)
18661866
return apr_pstrdup(ctx->pool, "");
18671867

1868-
if (ctx->finfo.filetype != 0) {
1868+
if (ctx->finfo.filetype != APR_NOFILE) {
18691869
return apr_psprintf(ctx->pool, "\"%" APR_UINT64_T_HEX_FMT "-%"
18701870
APR_UINT64_T_HEX_FMT "-%" APR_UINT64_T_HEX_FMT "\"",
18711871
(apr_uint64_t) ctx->finfo.inode,

modules/filters/mod_include.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -973,7 +973,7 @@ static int find_file(request_rec *r, const char *directive, const char *tag,
973973
we never attempt to "run" this sub request. */
974974
rr = ap_sub_req_lookup_file(newpath, r, NULL);
975975

976-
if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
976+
if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
977977
to_send = rr->filename;
978978
if ((rv = apr_stat(finfo, to_send,
979979
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,
10031003
we never attempt to "run" this sub request. */
10041004
rr = ap_sub_req_lookup_uri(tag_val, r, NULL);
10051005

1006-
if (rr->status == HTTP_OK && rr->finfo.filetype != 0) {
1006+
if (rr->status == HTTP_OK && rr->finfo.filetype != APR_NOFILE) {
10071007
memcpy((char *) finfo, (const char *) &rr->finfo,
10081008
sizeof(rr->finfo));
10091009
ap_destroy_sub_req(rr);

modules/generators/mod_asis.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ static int asis_handler(request_rec *r)
4141
r->allowed |= (AP_METHOD_BIT << M_GET);
4242
if (r->method_number != M_GET)
4343
return DECLINED;
44-
if (r->finfo.filetype == 0) {
44+
if (r->finfo.filetype == APR_NOFILE) {
4545
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
4646
"File does not exist: %s", r->filename);
4747
return HTTP_NOT_FOUND;

modules/generators/mod_cgi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ static int cgi_handler(request_rec *r)
775775
return log_scripterror(r, conf, HTTP_FORBIDDEN, 0,
776776
"attempt to include NPH CGI script");
777777

778-
if (r->finfo.filetype == 0)
778+
if (r->finfo.filetype == APR_NOFILE)
779779
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
780780
"script not found or unable to stat");
781781
if (r->finfo.filetype == APR_DIR)

modules/generators/mod_cgid.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ static int cgid_handler(request_rec *r)
13731373
#error mod_cgid does not work on this platform. If you teach it to, look
13741374
#error at mod_cgi.c for required code in this path.
13751375
#else
1376-
if (r->finfo.filetype == 0)
1376+
if (r->finfo.filetype == APR_NOFILE)
13771377
return log_scripterror(r, conf, HTTP_NOT_FOUND, 0,
13781378
"script not found or unable to stat");
13791379
#endif

modules/http/http_etag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ AP_DECLARE(char *) ap_make_etag(request_rec *r, int force_weak)
109109
weak_len = sizeof(ETAG_WEAK);
110110
}
111111

112-
if (r->finfo.filetype != 0) {
112+
if (r->finfo.filetype != APR_NOFILE) {
113113
/*
114114
* ETag gets set to [W/]"inode-size-mtime", modulo any
115115
* FileETag keywords.

modules/mappers/mod_actions.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int action_handler(request_rec *r)
180180
ap_field_noparam(r->pool, r->content_type);
181181

182182
if (action && (t = apr_table_get(conf->action_types, action))) {
183-
if (*t++ == '0' && r->finfo.filetype == 0) {
183+
if (*t++ == '0' && r->finfo.filetype == APR_NOFILE) {
184184
ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
185185
"File does not exist: %s", r->filename);
186186
return HTTP_NOT_FOUND;

modules/mappers/mod_speling.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ static int check_speling(request_rec *r)
211211
}
212212

213213
/* We've already got a file of some kind or another */
214-
if (r->finfo.filetype != 0) {
214+
if (r->finfo.filetype != APR_NOFILE) {
215215
return DECLINED;
216216
}
217217

modules/metadata/mod_cern_meta.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static int add_cern_meta_data(request_rec *r)
285285

286286
/* if ./.web/$1.meta exists then output 'asis' */
287287

288-
if (r->finfo.filetype == 0) {
288+
if (r->finfo.filetype == APR_NOFILE) {
289289
return DECLINED;
290290
};
291291

modules/metadata/mod_expires.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,7 @@ static int set_expiration_fields(request_rec *r, const char *code,
402402

403403
switch (code[0]) {
404404
case 'M':
405-
if (r->finfo.filetype == 0) {
405+
if (r->finfo.filetype == APR_NOFILE) {
406406
/* file doesn't exist on disk, so we can't do anything based on
407407
* modification time. Note that this does _not_ log an error.
408408
*/

0 commit comments

Comments
 (0)