diff options
author | Keir Fraser <keir.fraser@citrix.com> | 2009-06-17 07:21:03 +0100 |
---|---|---|
committer | Keir Fraser <keir.fraser@citrix.com> | 2009-06-17 07:21:03 +0100 |
commit | 6f1d3ce238905fc7b4c563a3611576ca25a09a49 (patch) | |
tree | 164961c069a3b70d82d0ce105e9a363d71cacaaf /extras | |
parent | c93bd0e6ea2a0295f56abd4e58cbb0761f299f0d (diff) | |
download | xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.tar.gz xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.tar.bz2 xen-6f1d3ce238905fc7b4c563a3611576ca25a09a49.zip |
Introduce mechanism to check standard conformance of headers
While pretty simplistic, it appears to serve the purpose at the moment
(i.e. it spotted two places where a GNU extension was used withou
proper preprocessor conditionals). The "simplistic" here includes that
the checking gets only done for native builds, and ia64 gets excluded
due to its arch-specific header intentionally (for whatever reason)
checking that anonymous struct/unions can be used.
Signed-off-by: Jan Beulich <jbeulich@novell.com>
Diffstat (limited to 'extras')
-rw-r--r-- | extras/mini-os/fs-front.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/extras/mini-os/fs-front.c b/extras/mini-os/fs-front.c index b72fadaacb..b22266dd23 100644 --- a/extras/mini-os/fs-front.c +++ b/extras/mini-os/fs-front.c @@ -218,7 +218,7 @@ int fs_open(struct fs_import *import, char *file) schedule(); /* Read the response */ - fd = (int)fsr->shadow_rsp.ret_val; + fd = (int)fsr->shadow_rsp.u.ret_val; DEBUG("The following FD returned: %d\n", fd); free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); @@ -256,7 +256,7 @@ int fs_close(struct fs_import *import, int fd) schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("Close returned: %d\n", ret); add_id_to_freelist(priv_req_id, import->freelist); @@ -313,7 +313,7 @@ ssize_t fs_read(struct fs_import *import, int fd, void *buf, schedule(); /* Read the response */ - ret = (ssize_t)fsr->shadow_rsp.ret_val; + ret = (ssize_t)fsr->shadow_rsp.u.ret_val; DEBUG("The following ret value returned %d\n", ret); if(ret > 0) { @@ -391,7 +391,7 @@ ssize_t fs_write(struct fs_import *import, int fd, void *buf, schedule(); /* Read the response */ - ret = (ssize_t)fsr->shadow_rsp.ret_val; + ret = (ssize_t)fsr->shadow_rsp.u.ret_val; DEBUG("The following ret value returned %d\n", ret); for(i=0; i<gnts.count; i++) { @@ -435,10 +435,10 @@ int fs_stat(struct fs_import *import, schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("Following ret from fstat: %d\n", ret); memcpy(stat, - &fsr->shadow_rsp.fstat, + &fsr->shadow_rsp.u.fstat, sizeof(struct fsif_stat_response)); add_id_to_freelist(priv_req_id, import->freelist); @@ -478,7 +478,7 @@ int fs_truncate(struct fs_import *import, schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("Following ret from ftruncate: %d\n", ret); add_id_to_freelist(priv_req_id, import->freelist); @@ -520,7 +520,7 @@ int fs_remove(struct fs_import *import, char *file) schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("The following ret: %d\n", ret); free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); @@ -575,7 +575,7 @@ int fs_rename(struct fs_import *import, schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("The following ret: %d\n", ret); free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); @@ -621,7 +621,7 @@ int fs_create(struct fs_import *import, char *name, schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("The following ret: %d\n", ret); free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); @@ -670,7 +670,7 @@ char** fs_list(struct fs_import *import, char *name, schedule(); /* Read the response */ - *nr_files = (fsr->shadow_rsp.ret_val & NR_FILES_MASK) >> NR_FILES_SHIFT; + *nr_files = (fsr->shadow_rsp.u.ret_val & NR_FILES_MASK) >> NR_FILES_SHIFT; files = NULL; if(*nr_files <= 0) goto exit; files = malloc(sizeof(char*) * (*nr_files)); @@ -681,7 +681,7 @@ char** fs_list(struct fs_import *import, char *name, current_file += strlen(current_file) + 1; } if(has_more != NULL) - *has_more = fsr->shadow_rsp.ret_val & HAS_MORE_FLAG; + *has_more = fsr->shadow_rsp.u.ret_val & HAS_MORE_FLAG; free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); exit: @@ -719,7 +719,7 @@ int fs_chmod(struct fs_import *import, int fd, int32_t mode) schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("The following returned: %d\n", ret); add_id_to_freelist(priv_req_id, import->freelist); @@ -761,7 +761,7 @@ int64_t fs_space(struct fs_import *import, char *location) schedule(); /* Read the response */ - ret = (int64_t)fsr->shadow_rsp.ret_val; + ret = (int64_t)fsr->shadow_rsp.u.ret_val; DEBUG("The following returned: %lld\n", ret); free_buffer_page(fsr); add_id_to_freelist(priv_req_id, import->freelist); @@ -799,7 +799,7 @@ int fs_sync(struct fs_import *import, int fd) schedule(); /* Read the response */ - ret = (int)fsr->shadow_rsp.ret_val; + ret = (int)fsr->shadow_rsp.u.ret_val; DEBUG("Close returned: %d\n", ret); add_id_to_freelist(priv_req_id, import->freelist); @@ -852,7 +852,7 @@ moretodo: rsp = RING_GET_RESPONSE(&import->ring, cons); DEBUG("Response at idx=%d to request id=%d, ret_val=%lx\n", - cons, rsp->id, rsp->ret_val); + cons, rsp->id, rsp->u.ret_val); req = &import->requests[rsp->id]; memcpy(&req->shadow_rsp, rsp, sizeof(struct fsif_response)); DEBUG("Waking up: %s\n", req->thread->name); |