summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Malaterre <mathieu.malaterre@gmail.com>2012-01-30 09:27:35 +0000
committerMathieu Malaterre <mathieu.malaterre@gmail.com>2012-01-30 09:27:35 +0000
commit7d0a419c871fc16a3c5331cebc9556e1cee7128a (patch)
tree6d480e862c9770c4af6efce7aa1f36132c69f2b3
parent0ea0e8b915098a9ece5fbd168a8bb90f171e02dc (diff)
fix declarations
-rw-r--r--applications/jpip/libopenjpip/byte_manager.c7
-rw-r--r--applications/jpip/libopenjpip/target_manager.c24
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 <stdio.h>
+#ifdef _WIN32
+#include <io.h>
+#else
#include <sys/types.h>
+#include <unistd.h>
+#endif
#include <stdlib.h>
#include <sys/stat.h>
#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 <stdlib.h>
#include <string.h>
#include <stdio.h>
+#ifdef _WIN32
+#include <io.h>
+#else
#include <sys/types.h>
+#include <unistd.h>
+#endif
#include <sys/stat.h>
#include <fcntl.h>
#include <time.h>
@@ -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*/