From 7d0a419c871fc16a3c5331cebc9556e1cee7128a Mon Sep 17 00:00:00 2001 From: Mathieu Malaterre Date: Mon, 30 Jan 2012 09:27:35 +0000 Subject: [PATCH] fix declarations --- applications/jpip/libopenjpip/byte_manager.c | 7 +++++- .../jpip/libopenjpip/target_manager.c | 24 ++++++++++++------- 2 files changed, 21 insertions(+), 10 deletions(-) diff --git a/applications/jpip/libopenjpip/byte_manager.c b/applications/jpip/libopenjpip/byte_manager.c index e0c628b1..4dd887bc 100644 --- a/applications/jpip/libopenjpip/byte_manager.c +++ b/applications/jpip/libopenjpip/byte_manager.c @@ -29,7 +29,12 @@ */ #include +#ifdef _WIN32 +#include +#else #include +#include +#endif #include #include #include "byte_manager.h" @@ -41,7 +46,7 @@ #define FCGI_stdout stdout #define FCGI_stderr stderr #define logstream stderr -#endif //SERVER +#endif /*SERVER*/ Byte_t * fetch_bytes( int fd, long offset, int size) diff --git a/applications/jpip/libopenjpip/target_manager.c b/applications/jpip/libopenjpip/target_manager.c index db084ee1..95dc9294 100644 --- a/applications/jpip/libopenjpip/target_manager.c +++ b/applications/jpip/libopenjpip/target_manager.c @@ -31,7 +31,12 @@ #include #include #include +#ifdef _WIN32 +#include +#else #include +#include +#endif #include #include #include @@ -45,7 +50,7 @@ #define FCGI_stdout stdout #define FCGI_stderr stderr #define logstream stderr -#endif //SERVER +#endif /*SERVER*/ targetlist_param_t * gene_targetlist() { @@ -109,9 +114,9 @@ target_param_t * gene_target( targetlist_param_t *targetlist, char *targetpath) target->jptstream = isJPTfeasible( *jp2idx); target->next=NULL; - if( targetlist->first) // there are one or more entries + if( targetlist->first) /* there are one or more entries*/ targetlist->last->next = target; - else // first entry + else /* first entry*/ targetlist->first = target; targetlist->last = target; @@ -248,7 +253,7 @@ int open_jp2file( char filepath[], char tmpfname[]) int fd; char *data; - // download remote target file to local storage + /* download remote target file to local storage*/ if( strncmp( filepath, "http://", 7) == 0){ if( (fd = open_remotefile( filepath, tmpfname)) == -1) return -1; @@ -260,14 +265,14 @@ int open_jp2file( char filepath[], char tmpfname[]) return -1; } } - // Check resource is a JP family file. + /* Check resource is a JP family file.*/ if( lseek( fd, 0, SEEK_SET)==-1){ close(fd); fprintf( FCGI_stdout, "Reason: Target %s broken (lseek error)\r\n", filepath); return -1; } - data = (char *)malloc( 12); // size of header + data = (char *)malloc( 12); /* size of header*/ if( read( fd, data, 12) != 12){ free( data); @@ -296,7 +301,8 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream); int open_remotefile( char filepath[], char tmpfname[]) { #ifndef SERVER - + (void)filepath; + (void)tmpfname; fprintf( FCGI_stderr, "Remote file can not be opened in local mode\n"); return -1; @@ -322,7 +328,7 @@ int open_remotefile( char filepath[], char tmpfname[]) curl_easy_cleanup(curl_handle); return fd; -#endif //SERVER +#endif /*SERVER*/ } #ifdef SERVER @@ -333,4 +339,4 @@ static size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) return written; } -#endif //SERVER +#endif /*SERVER*/