Commit ea9068c743f47b11ae15fa0539e870fd259d60af
1 parent
a2be90e4
Exists in
ubuntu
Fix all warning with compilation
Showing
30 changed files
with
85 additions
and
50 deletions
Show diff stats
cmake/modules/FindNetCDF.cmake
... | ... | @@ -15,7 +15,7 @@ find_library(NETCDFLIBRARY |
15 | 15 | mark_as_advanced(NETCDFLIBRARY) |
16 | 16 | |
17 | 17 | include(FindPackageHandleStandardArgs) |
18 | -FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCdf DEFAULT_MSG NETCDFLIBRARY NETCDFINCLUDE_DIR) | |
18 | +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NetCDF DEFAULT_MSG NETCDFLIBRARY NETCDFINCLUDE_DIR) | |
19 | 19 | |
20 | 20 | if(NETCDF_FOUND) |
21 | 21 | set(NETCDFINCLUDE_DIRS ${NETCDFINCLUDE_DIR}) | ... | ... |
src/DATA/TOOLS/CleanNoData.c
... | ... | @@ -72,7 +72,7 @@ typedef struct |
72 | 72 | /*================================================================================== |
73 | 73 | * MAIN |
74 | 74 | *==================================================================================*/ |
75 | -main(int argc, char **argv) | |
75 | +int main(int argc, char **argv) | |
76 | 76 | { |
77 | 77 | static char usage[] = "usage: CleanNoData nc_times_file "; |
78 | 78 | ... | ... |
src/DATA/TOOLS/ConvertDDTimeToDouble.c
... | ... | @@ -398,7 +398,7 @@ int convertNCFile(char* oldFilePath, char* newFilePath) { |
398 | 398 | #define COMMAND_MAX_LEN 1000 |
399 | 399 | #define MAX_FILENAME_LEN 100 |
400 | 400 | |
401 | -main(int argc, char **argv) | |
401 | +int main(int argc, char **argv) | |
402 | 402 | { |
403 | 403 | static char usage[] = "usage: ConvertDDTimeToDouble nc_data_file[*.gz]"; |
404 | 404 | ... | ... |
src/DATA/TOOLS/DDClearTimes.c
src/DATA/TOOLS/DDtimedump.c
src/DATA/TOOLS/GetGranules.c
... | ... | @@ -111,7 +111,7 @@ int main(int argc, char *argv[]) |
111 | 111 | strcat(filePath, ".gz"); |
112 | 112 | stat(filePath, &attrib); |
113 | 113 | |
114 | - printf("%f %f %s %d\n", StartTimestamp, StopTimestamp, FileName, attrib.st_mtime); | |
114 | + printf("%f %f %s %ld\n", StartTimestamp, StopTimestamp, FileName, attrib.st_mtime); | |
115 | 115 | } |
116 | 116 | |
117 | 117 | if ((status = nc_close(DataID)) != NC_NOERR) nc_handle_error(status); | ... | ... |
src/DATA/TOOLS/TimesUpdate.c
... | ... | @@ -247,7 +247,7 @@ int InsertRecord(size_t RecordPos, t_StartStop *StartStop) |
247 | 247 | /*================================================================================== |
248 | 248 | * MAIN |
249 | 249 | *==================================================================================*/ |
250 | -main(int argc, char **argv) | |
250 | +int main(int argc, char **argv) | |
251 | 251 | { |
252 | 252 | static char usage[] = "usage: TimesUpdate -r/-i[-u]/-d nc_times_file nc_data_file[*.gz] nc_data_file[*.gz]"; |
253 | 253 | |
... | ... | @@ -265,7 +265,7 @@ main(int argc, char **argv) |
265 | 265 | char tmName[NAME_DIM]; |
266 | 266 | int i, InsertFlag, FindFlag, ihole; |
267 | 267 | |
268 | - char command[100]; | |
268 | + char command[200]; | |
269 | 269 | char name[100]; |
270 | 270 | int compress = 0; |
271 | 271 | int status; | ... | ... |
src/DATA/TOOLS/TimesUpdateNoData.c
... | ... | @@ -142,7 +142,7 @@ int InsertRecord(size_t RecordPos, t_StartStop *StartStop) |
142 | 142 | /*================================================================================== |
143 | 143 | * MAIN |
144 | 144 | *==================================================================================*/ |
145 | -main(int argc, char **argv) | |
145 | +int main(int argc, char **argv) | |
146 | 146 | { |
147 | 147 | static char usage[] = "usage: TimesUpdateNoData nc_times_file StartTime StopTime"; |
148 | 148 | ... | ... |
src/DDADMIN/TOOLS/CMakeLists.txt
src/DDADMIN/TOOLS/DDadmin.c
... | ... | @@ -23,6 +23,7 @@ |
23 | 23 | #include <limits.h> |
24 | 24 | #include <unistd.h> |
25 | 25 | #include <time.h> |
26 | +#include <crypt.h> | |
26 | 27 | #include <DD.h> |
27 | 28 | #include <netcdf.h> |
28 | 29 | #include <DD_Access.h> |
... | ... | @@ -76,6 +77,11 @@ typedef struct { |
76 | 77 | long PwdLen; |
77 | 78 | } t_UserFileInfo; |
78 | 79 | |
80 | +int GetLoginFromIndex(int index, t_UserFileInfo *fileInfo, char *login); | |
81 | +int GetPwdFromIndex(int index, t_UserFileInfo *fileInfo, char *pwd_hash); | |
82 | +int SetLoginToIndex(int index, t_UserFileInfo *fileInfo, char *login); | |
83 | +int SetPwdToIndex(int index, t_UserFileInfo *fileInfo, char *pwd_hash); | |
84 | + | |
79 | 85 | //--------------------------------------------------------------------------- |
80 | 86 | void Usage(void) |
81 | 87 | { |
... | ... | @@ -432,7 +438,7 @@ int CleanUserFile(void) |
432 | 438 | CloseUserFile(&fileInfo); |
433 | 439 | CloseUserFile(&tmpFileInfo); |
434 | 440 | |
435 | - char cmd[2048]; | |
441 | + char cmd[3000]; | |
436 | 442 | sprintf(cmd,"cp %s %s",tmpname,refname); |
437 | 443 | system(cmd); |
438 | 444 | sprintf(cmd,"rm %s",tmpname); |
... | ... | @@ -451,7 +457,7 @@ int CreateSaveUserFile(void) |
451 | 457 | strcpy(savename,refname); |
452 | 458 | strcat(savename,"~"); |
453 | 459 | |
454 | - char cmd[2048]; | |
460 | + char cmd[3000]; | |
455 | 461 | sprintf(cmd,"cp %s %s",refname,savename); |
456 | 462 | system(cmd); |
457 | 463 | |
... | ... | @@ -689,7 +695,7 @@ int CompleteRequest(t_Request *request, t_UserFileInfo *fileInfo) |
689 | 695 | return 1; |
690 | 696 | } |
691 | 697 | //--------------------------------------------------------------------------- |
692 | -main (int argc, char *argv[]) | |
698 | +int main (int argc, char *argv[]) | |
693 | 699 | { |
694 | 700 | srand(time(NULL)); |
695 | 701 | ... | ... |
src/DDSERVICES/TOOLS/GetFileNames.c
src/DDSERVICES/TOOLS/GetInfo.c
... | ... | @@ -33,7 +33,7 @@ void nc_handle_error(int status) |
33 | 33 | |
34 | 34 | int status, len, infoID, i; |
35 | 35 | |
36 | - char Project[50],Instrument[50],Mode[50], RInstrName[100], INFO_ID[50]; | |
36 | + char Project[50],Instrument[50],Mode[50], RInstrName[200], INFO_ID[50]; | |
37 | 37 | int dims[10]; |
38 | 38 | size_t lenp, total_length; |
39 | 39 | float *value; |
... | ... | @@ -53,8 +53,10 @@ void nc_handle_error(int status) |
53 | 53 | Instrument, |
54 | 54 | Mode); |
55 | 55 | |
56 | - sprintf(RInstrName,"%s_%s_%s\0",Project,Instrument,Mode); | |
57 | - sprintf(INFO_ID,"%s\0",argv[3]); | |
56 | + memset(RInstrName, 0, 200*sizeof(char)); | |
57 | + sprintf(RInstrName,"%s_%s_%s",Project,Instrument,Mode); | |
58 | + memset(INFO_ID, 0, 50*sizeof(char)); | |
59 | + sprintf(INFO_ID,"%s",argv[3]); | |
58 | 60 | |
59 | 61 | if ((status = nc_inq_varid(DataID,RInstrName,&VarID)) != NC_NOERR) |
60 | 62 | nc_handle_error(status); |
... | ... | @@ -82,7 +84,7 @@ void nc_handle_error(int status) |
82 | 84 | if ((status = nc_inq_varndims(DataID, infoID, &ndimsp)) != NC_NOERR) |
83 | 85 | nc_handle_error(status); |
84 | 86 | |
85 | - if ((status = nc_inq_vardimid(DataID, infoID, &dims)) != NC_NOERR) | |
87 | + if ((status = nc_inq_vardimid(DataID, infoID, dims)) != NC_NOERR) | |
86 | 88 | nc_handle_error(status); |
87 | 89 | total_length = 0; |
88 | 90 | for ( i = 0; i < ndimsp; i++) { | ... | ... |
src/DDSERVICES/TOOLS/StartStop.c
... | ... | @@ -41,7 +41,7 @@ void nc_handle_error(int status) |
41 | 41 | |
42 | 42 | int status, len; |
43 | 43 | |
44 | - char Project[50],Instrument[50],Mode[50], RInstrName[100]; | |
44 | + char Project[50],Instrument[50],Mode[50], RInstrName[200]; | |
45 | 45 | |
46 | 46 | |
47 | 47 | if (argc < 3) |
... | ... | @@ -57,7 +57,8 @@ void nc_handle_error(int status) |
57 | 57 | sscanf(argv[2], "%[^:]%*c%[^:]%*c%[^:]%*c",Project, |
58 | 58 | Instrument, |
59 | 59 | Mode); |
60 | - sprintf(RInstrName,"%s_%s_%s\0",Project,Instrument,Mode); | |
60 | + memset(RInstrName, 0, 200*sizeof(char)); | |
61 | + sprintf(RInstrName,"%s_%s_%s",Project,Instrument,Mode); | |
61 | 62 | |
62 | 63 | if ((status = nc_inq_varid(DataID,RInstrName,&VarID)) != NC_NOERR) |
63 | 64 | nc_handle_error(status); | ... | ... |
src/DECODERS/ascii2nc/ascii2nc.c
... | ... | @@ -219,8 +219,9 @@ void handle_netcdf_error(int status) { |
219 | 219 | int YEAR, DAY, HOUR, MINUTE, SEC, MSK = 0; |
220 | 220 | err = sscanf(buffer, "%d-%dT%d:%d:%d.%d", |
221 | 221 | &YEAR, &DAY, &HOUR, &MINUTE, &SEC, &MSK); |
222 | - if (err == 5) MSK = 0; | |
223 | - sprintf(Time,"%04d%03d%02d%02d%02d%03d\0", YEAR, DAY-1, HOUR, MINUTE, SEC, MSK); | |
222 | + if (err == 5) MSK = 0; | |
223 | + memset(Time, 0, TIMELENGTH*sizeof(char)); | |
224 | + sprintf(Time,"%04d%03d%02d%02d%02d%03d", YEAR, DAY-1, HOUR, MINUTE, SEC, MSK); | |
224 | 225 | } |
225 | 226 | /*-------------------------------------------------------------------------- |
226 | 227 | * MONTH-DAY time to DD |
... | ... | @@ -231,6 +232,7 @@ void handle_netcdf_error(int status) { |
231 | 232 | |
232 | 233 | int i, YEAR, MONTH, DAY, HOUR, MINUTE, SEC, MSK, DOY=0; |
233 | 234 | |
235 | + memset(Time, 0, TIMELENGTH*sizeof(char)); | |
234 | 236 | sscanf(buffer, "%d-%d-%dT%d:%d:%d.%d", |
235 | 237 | &YEAR, &MONTH, &DAY, &HOUR, &MINUTE, &SEC, &MSK); |
236 | 238 | |
... | ... | @@ -244,6 +246,6 @@ void handle_netcdf_error(int status) { |
244 | 246 | for (i = 0; i < MONTH - 1; i++) DOY += days[i]; |
245 | 247 | DOY += DAY; |
246 | 248 | |
247 | - sprintf(Time,"%04d%03d%02d%02d%02d%03d\0", YEAR, DOY-1, HOUR, MINUTE, SEC, MSK); | |
249 | + sprintf(Time,"%04d%03d%02d%02d%02d%03d", YEAR, DOY-1, HOUR, MINUTE, SEC, MSK); | |
248 | 250 | } |
249 | 251 | ... | ... |
src/DECODERS/cdfnew2nc/cdfnew2nc.c
... | ... | @@ -370,7 +370,7 @@ void get_cdf_attribute(long attrNum, /* in - CDF attribute number/id */ |
370 | 370 | numElements; |
371 | 371 | nc_type ncDatatype; /* netCDF datatype */ |
372 | 372 | |
373 | - char *cPtr, attrName[CDF_ATTR_NAME_LEN256+1], | |
373 | + char *cPtr, attrName[CDF_ATTR_NAME_LEN256+1024], | |
374 | 374 | mappedAttrName[CDF_ATTR_NAME_LEN256+1]; |
375 | 375 | |
376 | 376 | status = CDFlib (SELECT_, ATTR_, attrNum, |
... | ... | @@ -1565,7 +1565,7 @@ char * ptr; |
1565 | 1565 | strcpy (ptr, isotime_to_dd_time (ep16String)); |
1566 | 1566 | ptr += DD_TIME_STRING_LEN; |
1567 | 1567 | } |
1568 | - printf(" %d %d\n", count[0], count[1]); | |
1568 | + printf(" %zu %zu\n", count[0], count[1]); | |
1569 | 1569 | ncstatus = nc_put_vara_text(ncid, ncVarId, start, count, cPtr); |
1570 | 1570 | if (ncstatus != NC_NOERR) handle_netcdf_error(ncstatus); |
1571 | 1571 | free (cPtr); | ... | ... |
src/DECODERS/cdfnew2nc/tools.c
... | ... | @@ -48,7 +48,7 @@ int check_version (void) |
48 | 48 | goto EXIT; |
49 | 49 | } |
50 | 50 | |
51 | - sprintf (str_version, "%d.%d.%d-%c", version, release, increment, subincrement); | |
51 | + sprintf (str_version, "%ld.%ld.%ld-%c", version, release, increment, subincrement); | |
52 | 52 | |
53 | 53 | printf ("CDFlib version : %s\n", str_version); |
54 | 54 | |
... | ... | @@ -100,7 +100,7 @@ char * isotime_to_dd_time (char * input) |
100 | 100 | |
101 | 101 | for (i = 1; i < mm; i++) ddd += duration [i]; |
102 | 102 | |
103 | - sprintf (output, "%04.4d%03.3d%02.2d%02.2d%02.2d%03.3d", | |
103 | + sprintf (output, "%4.4d%3.3d%2.2d%2.2d%2.2d%3.3d", | |
104 | 104 | yy, ddd, h, m, s, ms); |
105 | 105 | |
106 | 106 | EXIT: return output; |
... | ... | @@ -192,7 +192,7 @@ NO_DEPEND_0 : for (varId = 0; varId < nZvars; varId++) { |
192 | 192 | |
193 | 193 | status = CDFinquirezVar (id, varId, name, & dataType, & numElems, |
194 | 194 | & numDims, dimSizes, & recVary, dimVarys); |
195 | - if (status != CDF_OK) cdf_status_handler (status); | |
195 | + if (status != CDF_OK) cdf_status_handler (status, "CDFinquirezVar"); | |
196 | 196 | if ( dataType == CDF_EPOCH ) { |
197 | 197 | timeVarName = strdup (name); |
198 | 198 | printf ("Identified time variable : %s\n", timeVarName); |
... | ... | @@ -309,7 +309,7 @@ int get_file_coverage (char * start_coverage, char * stop_coverage) |
309 | 309 | |
310 | 310 | break; |
311 | 311 | default: |
312 | - printf ("Error : variable %d is not a Time variable\n"); | |
312 | + printf ("Error : variable %s is not a Time variable\n", varName); | |
313 | 313 | goto EXIT; |
314 | 314 | } |
315 | 315 | ... | ... |
src/DECODERS/cdfnew2nc/tools.h
... | ... | @@ -3,8 +3,16 @@ |
3 | 3 | |
4 | 4 | #define DD_TIME_STRING_LEN 17 |
5 | 5 | |
6 | +#include "cdf.h" | |
7 | + | |
6 | 8 | int set_file_time_coverage (); |
7 | 9 | |
8 | 10 | char * isotime_to_dd_time (char * str_isotime); |
9 | 11 | |
12 | +int check_version (void); | |
13 | + | |
14 | +int rename_time_variable (); | |
15 | + | |
16 | +void cdf_status_handler (CDFstatus status, char *source); | |
17 | + | |
10 | 18 | #endif | ... | ... |
src/DECODERS/nc2nc/nc2nc.c
src/DECODERS/themis/themis_esa2nc.c
... | ... | @@ -375,7 +375,7 @@ int main(int argc, char *argv[]) |
375 | 375 | cstatus = CDFlib(GET_, zVAR_NUMBER_, PAR16, &par16, NULL_); |
376 | 376 | |
377 | 377 | RecCount = (long)(MaxRec+1); |
378 | - printf(" Max Rec %d\n", MaxRec); | |
378 | + printf(" Max Rec %ld\n", MaxRec); | |
379 | 379 | |
380 | 380 | value = (double *)malloc(sizeof(double)* RecCount); |
381 | 381 | if ((cstatus = CDFlib (SELECT_, | ... | ... |
src/DECODERS/themis/themis_esamom2nc.c
... | ... | @@ -261,7 +261,7 @@ int main(int argc, char *argv[]) |
261 | 261 | |
262 | 262 | |
263 | 263 | RecCount = (long)(MaxRec+1); |
264 | - printf(" Max Rec %d\n", MaxRec); | |
264 | + printf(" Max Rec %ld\n", MaxRec); | |
265 | 265 | if ( RecCount > 0) { |
266 | 266 | value = (double *)malloc(sizeof(double)* RecCount); |
267 | 267 | if ((cstatus = CDFlib (SELECT_, | ... | ... |
src/DECODERS/themis/themis_fgm2nc.c
... | ... | @@ -275,7 +275,7 @@ int main(int argc, char *argv[]) |
275 | 275 | cdf_handle_error (cstatus) ; |
276 | 276 | |
277 | 277 | RecCount = (long)(MaxRec+1); |
278 | - printf(" Max Rec %d\n", MaxRec); | |
278 | + printf(" Max Rec %ld\n", MaxRec); | |
279 | 279 | if (MaxRec > 1) |
280 | 280 | { |
281 | 281 | value = (double *)malloc(sizeof(double)* RecCount); | ... | ... |
src/DECODERS/themis/themis_sst2nc.c
... | ... | @@ -164,7 +164,7 @@ void ncdefine(double Time) |
164 | 164 | nc_put_vara_text(ncID, StartTimeID, &(Start[1]), &(TimeCount[1]), Double2DD_Time(Time)); |
165 | 165 | } |
166 | 166 | |
167 | -void put_double(RecStart, RecCount, ParCDF, ParNC) | |
167 | +void put_double(long RecStart, long RecCount, long ParCDF, int ParNC) | |
168 | 168 | { |
169 | 169 | long RecInt = 1; |
170 | 170 | long indices[1] = {0}, intervals[1] = {1}, counts[1] = {1}; |
... | ... | @@ -187,7 +187,7 @@ void put_double(RecStart, RecCount, ParCDF, ParNC) |
187 | 187 | } |
188 | 188 | |
189 | 189 | |
190 | -void put_mode(RecStart, RecCount, ParCDF, ParNC) | |
190 | +void put_mode(long RecStart, long RecCount, long ParCDF, int ParNC) | |
191 | 191 | { |
192 | 192 | float *value; |
193 | 193 | long indices[2] = {0,3}, intervals[1] = {1}, counts[1] = {3}; |
... | ... | @@ -208,7 +208,7 @@ void put_mode(RecStart, RecCount, ParCDF, ParNC) |
208 | 208 | free(value); |
209 | 209 | } |
210 | 210 | |
211 | -void put_spectra(RecStart, RecCount, ParCDF, ParNC) | |
211 | +void put_spectra(long RecStart, long RecCount, long ParCDF, int ParNC) | |
212 | 212 | { |
213 | 213 | double *value; |
214 | 214 | long indices[2] = {0,16}, intervals[1] = {1}, counts[1] = {16}; |
... | ... | @@ -288,7 +288,7 @@ int main(int argc, char *argv[]) |
288 | 288 | |
289 | 289 | |
290 | 290 | RecCount = (long)(MaxRec+1); |
291 | - printf(" Max Rec %d\n", MaxRec); | |
291 | + printf(" Max Rec %ld\n", MaxRec); | |
292 | 292 | if (MaxRec > 1) |
293 | 293 | { |
294 | 294 | value = (double *)malloc(sizeof(double)* RecCount); | ... | ... |
src/SERVER/CMakeLists.txt
src/SERVER/DD_Access_sr.c
... | ... | @@ -17,6 +17,7 @@ |
17 | 17 | #define _XOPEN_SOURCE |
18 | 18 | #include <unistd.h> |
19 | 19 | #include <time.h> |
20 | +#include <crypt.h> | |
20 | 21 | #include <DD.h> |
21 | 22 | #include <netcdf.h> |
22 | 23 | #include <DD_comm.h> |
... | ... | @@ -126,7 +127,7 @@ int GetTicket(int UID, char *HostName, int DD_user_id) |
126 | 127 | } |
127 | 128 | while((Find != 1) && (CurHostName[0] != '\0') && (CashStart[0] < USERCASHLEN)); |
128 | 129 | |
129 | - if(Verbose) fprintf(stderr,"FINISH TIME : %ld\n",TimeFinish); | |
130 | + if(Verbose) fprintf(stderr,"FINISH TIME : %d\n",TimeFinish); | |
130 | 131 | |
131 | 132 | CashStart[0]--; |
132 | 133 | ... | ... |
src/SERVER/DD_Cache.c
... | ... | @@ -179,12 +179,14 @@ void Cache_DecompressDataFile(DD_Var_t *D, char* dataFileName) |
179 | 179 | } |
180 | 180 | |
181 | 181 | char command[300]; |
182 | + memset(command, 0, 300*sizeof(char)); | |
182 | 183 | strcpy(command, "gunzip -c "); |
183 | 184 | strcat(command,FullName); |
184 | 185 | strcat(command, ".gz > "); |
185 | 186 | strcat(command, FullName); |
186 | 187 | system(command); /* File is unzipped */ |
187 | - sprintf(command, "chmod g+w %s\0",FullName); | |
188 | + memset(command, 0, 300*sizeof(char)); | |
189 | + sprintf(command, "chmod g+w %s",FullName); | |
188 | 190 | system(command); /* File is unzipped */ |
189 | 191 | } |
190 | 192 | |
... | ... | @@ -195,6 +197,7 @@ void Cache_CompressDataFile(DD_Var_t *D, char* dataFileName) |
195 | 197 | { |
196 | 198 | //This is not really a compression, just a supression of the uncompressed data file |
197 | 199 | char command[300]; |
200 | + memset(command, 0, 300*sizeof(char)); | |
198 | 201 | strcpy(command, "rm -f "); |
199 | 202 | strcat(command,D->path); |
200 | 203 | strcat(command,dataFileName); |
... | ... | @@ -323,7 +326,7 @@ void Cache_Free() |
323 | 326 | int Cache_GetAndLockVI(char* VIID) |
324 | 327 | { |
325 | 328 | if (cache_data == NULL) |
326 | - return; | |
329 | + return -1; | |
327 | 330 | |
328 | 331 | int i; |
329 | 332 | int PID = getpid(); |
... | ... | @@ -429,6 +432,8 @@ int Cache_RequestDataFileAccess(DD_Var_t *D, char* dataFileName) |
429 | 432 | |
430 | 433 | //Retrieve VI in cache data |
431 | 434 | int cacheVIIndex = Cache_GetAndLockVI(D->InstrName); |
435 | + if (cacheVIIndex < 0) | |
436 | + return(CACHERR); | |
432 | 437 | |
433 | 438 | //Open Cache file if needed |
434 | 439 | |
... | ... | @@ -623,6 +628,8 @@ int Cache_ReleaseDataFileAccess(DD_Var_t *D) |
623 | 628 | |
624 | 629 | //Retrieve VI in cache data |
625 | 630 | int cacheVIIndex = Cache_GetAndLockVI(D->InstrName); |
631 | + if (cacheVIIndex < 0) | |
632 | + return(CACHERR); | |
626 | 633 | |
627 | 634 | //Refresh Cache Table in relation with the cache file |
628 | 635 | if (Cache_RefreshTable(D) != OK) | ... | ... |
src/SERVER/DD_GetData.c
... | ... | @@ -53,7 +53,9 @@ DD_Var_t **DD_Var ; /* Common for entire server session , all files */ |
53 | 53 | size_t MaxIDNumber; /* The size of DD_Var array. Defined when new DD_Server session starts*/ |
54 | 54 | |
55 | 55 | extern int Verbose; |
56 | -extern LocalOrigSync(DD_Var_t *Local, DD_Var_t *Orig); | |
56 | +extern int LocalOrigSync(DD_Var_t *Local, DD_Var_t *Orig); | |
57 | + | |
58 | +int SetOriginPointer(DD_Var_t *LocalVI, int ID); | |
57 | 59 | |
58 | 60 | /*#################################################################*/ |
59 | 61 | /*----------------------- OpenInstr -------------------------------*/ |
... | ... | @@ -1217,7 +1219,7 @@ int SetTime(DD_Var_t *DD_VarL, double VCTime) |
1217 | 1219 | } |
1218 | 1220 | |
1219 | 1221 | /* Get the file Name and open file */ |
1220 | - if(Verbose) fprintf(stderr,"SetTime(): File found: %d\n",DD_VarL->TimeRecNumber); | |
1222 | + if(Verbose) fprintf(stderr,"SetTime(): File found: %zu\n",DD_VarL->TimeRecNumber); | |
1221 | 1223 | if((status = SetNewFile(DD_VarL,0)) < 0) return status; |
1222 | 1224 | |
1223 | 1225 | /*===================================================================== |
... | ... | @@ -1273,7 +1275,7 @@ int SetTime(DD_Var_t *DD_VarL, double VCTime) |
1273 | 1275 | if((status = SetNewFile(DD_VarL,1)) < 0) return status; |
1274 | 1276 | DD_VarL->nc_rec = 0; |
1275 | 1277 | More = 0; |
1276 | - if(Verbose) fprintf(stderr,"SetTime(): Pointer is set as %s, TimesRecord %d FileRecord %d\n",StartTime,DD_VarL->TimeRecNumber, DD_VarL->nc_rec); | |
1278 | + if(Verbose) fprintf(stderr,"SetTime(): Pointer is set as %s, TimesRecord %zu FileRecord %zu\n",StartTime,DD_VarL->TimeRecNumber, DD_VarL->nc_rec); | |
1277 | 1279 | return 1; |
1278 | 1280 | } |
1279 | 1281 | start[0]++; |
... | ... | @@ -1325,7 +1327,7 @@ int SetTime(DD_Var_t *DD_VarL, double VCTime) |
1325 | 1327 | More = 0; |
1326 | 1328 | } |
1327 | 1329 | } while(More == 1); |
1328 | - if(Verbose) fprintf(stderr,"SetTime(): Pointer is set as %s, TimesRecord %d FileRecord %d\n",StartTime,DD_VarL->TimeRecNumber, DD_VarL->nc_rec); | |
1330 | + if(Verbose) fprintf(stderr,"SetTime(): Pointer is set as %s, TimesRecord %zu FileRecord %zu\n",StartTime,DD_VarL->TimeRecNumber, DD_VarL->nc_rec); | |
1329 | 1331 | |
1330 | 1332 | return(1); |
1331 | 1333 | } | ... | ... |
src/SERVER/DD_Server.c
src/SERVER/ExtDataRequest.c
... | ... | @@ -22,6 +22,7 @@ |
22 | 22 | |
23 | 23 | #include <unistd.h> |
24 | 24 | #include <string.h> |
25 | +#include <netcdf.h> | |
25 | 26 | #include "DD.h" |
26 | 27 | #include "DD_comm.h" |
27 | 28 | |
... | ... | @@ -157,7 +158,7 @@ char *Double2ISOTime(double CTime) |
157 | 158 | } |
158 | 159 | else |
159 | 160 | { |
160 | - if(Verbose) fprintf(stderr,"ExtDataRequest: We have to move to %d record, CTime = %s\n", start[0]+1,Double2DD_Time(CTime)); | |
161 | + if(Verbose) fprintf(stderr,"ExtDataRequest: We have to move to %zu record, CTime = %s\n", start[0]+1,Double2DD_Time(CTime)); | |
161 | 162 | start[0]++; |
162 | 163 | status = nc_get_vara_text(DD_Var->tmID, DD_Var->StartID,start,TimeCount,StartTime); |
163 | 164 | DStart = DD_Time2Double(StartTime); | ... | ... |
src/SERVER/ncfileop.c
... | ... | @@ -41,7 +41,7 @@ int CloseOldFile(DD_Var_t *D) |
41 | 41 | if(status < 0) |
42 | 42 | { |
43 | 43 | D->LastFileStatus = DATAFILEERR; |
44 | - if(Verbose) fprintf(stderr,"CloseOldFile: error while closed, message : \n", nc_strerror(status)); | |
44 | + if(Verbose) fprintf(stderr,"CloseOldFile: error while closed, message : %s\n", nc_strerror(status)); | |
45 | 45 | return DATAFILEERR; |
46 | 46 | } |
47 | 47 | if(Verbose) fprintf(stderr,"CloseOldFile: file closed\n"); |
... | ... | @@ -97,7 +97,7 @@ int SetNewFile(DD_Var_t *D, int N) |
97 | 97 | |
98 | 98 | /*--------------- Calculate the next file to open ---------------*/ |
99 | 99 | TestNumber = D->TimeRecNumber + N; |
100 | - if(Verbose) fprintf(stderr,"SetNewFile(): Record %d\n",TestNumber); | |
100 | + if(Verbose) fprintf(stderr,"SetNewFile(): Record %zu\n",TestNumber); | |
101 | 101 | |
102 | 102 | D->TimeRecNumber = TestNumber; |
103 | 103 | start[0] = TestNumber; |
... | ... | @@ -110,7 +110,7 @@ int SetNewFile(DD_Var_t *D, int N) |
110 | 110 | { |
111 | 111 | if(TestNumber > D->RValidMax) /* Out of existing data files */ |
112 | 112 | { |
113 | - if(Verbose) fprintf(stderr,"SetNewFile(): TestNumber %d exides D->RValidMax %d\n",TestNumber,D->RValidMax); | |
113 | + if(Verbose) fprintf(stderr,"SetNewFile(): TestNumber %zu exides D->RValidMax %d\n",TestNumber,D->RValidMax); | |
114 | 114 | |
115 | 115 | if(D->ExtCallAllowed) |
116 | 116 | { |
... | ... | @@ -155,7 +155,7 @@ int SetNewFile(DD_Var_t *D, int N) |
155 | 155 | * and NODATA segment if there is enough gap |
156 | 156 | */ |
157 | 157 | { |
158 | - if(Verbose) fprintf(stderr,"SetNewFile(): There is a gap %d\n",FirstTime - D->CDTime); | |
158 | + if(Verbose) fprintf(stderr,"SetNewFile(): There is a gap %f\n",FirstTime - D->CDTime); | |
159 | 159 | switch(status = ExtDataRequest(D, D->CDTime+D->MinGap)) |
160 | 160 | { |
161 | 161 | case OK: return WAITEXTCALL; |
... | ... | @@ -167,7 +167,7 @@ int SetNewFile(DD_Var_t *D, int N) |
167 | 167 | } |
168 | 168 | else /* Gap to NODATA interval is too small and we wiil try next time interval */ |
169 | 169 | { |
170 | - if(Verbose) fprintf(stderr,"SetNewFile(): Next File is NODATA, try file %d\n",++TestNumber); | |
170 | + if(Verbose) fprintf(stderr,"SetNewFile(): Next File is NODATA, try file %zu\n",++TestNumber); | |
171 | 171 | status = nc_get_vara_text(D->tmID, D->StopID,start,TimeCount,StopTime); |
172 | 172 | D->CDTime = DD_Time2Double(StopTime); |
173 | 173 | |
... | ... | @@ -188,7 +188,7 @@ int SetNewFile(DD_Var_t *D, int N) |
188 | 188 | // sleep(40); |
189 | 189 | if(D->ExtCallAllowed && ((FirstTime - D->CDTime) > D->MinGap)) |
190 | 190 | { |
191 | - if(Verbose) fprintf(stderr,"SetNewFile(): File OK, but there is a gap %d %d\n",FirstTime - D->CDTime, D->MinGap); | |
191 | + if(Verbose) fprintf(stderr,"SetNewFile(): File OK, but there is a gap %f %f\n",FirstTime - D->CDTime, D->MinGap); | |
192 | 192 | switch(status = ExtDataRequest(D, D->CDTime+D->MinGap)) |
193 | 193 | { |
194 | 194 | case OK: return WAITEXTCALL; | ... | ... |