[Getdata-commits] SF.net SVN: getdata:[758] trunk/defile
Scientific Database Format
Brought to you by:
ketiltrout
|
From: <ket...@us...> - 2012-08-14 22:27:30
|
Revision: 758
http://getdata.svn.sourceforge.net/getdata/?rev=758&view=rev
Author: ketiltrout
Date: 2012-08-14 22:27:24 +0000 (Tue, 14 Aug 2012)
Log Message:
-----------
type conversions.
Modified Paths:
--------------
trunk/defile/input/ascii.c
trunk/defile/lib/defile.h
trunk/defile/lib/internal.h
trunk/defile/lib/libdefile.c
Modified: trunk/defile/input/ascii.c
===================================================================
--- trunk/defile/input/ascii.c 2012-08-14 20:26:01 UTC (rev 757)
+++ trunk/defile/input/ascii.c 2012-08-14 22:27:24 UTC (rev 758)
@@ -417,7 +417,7 @@
*ptr = ptr2 + (*ptr - *tok);
*tok = ptr2;
}
- *((*ptr)++) = c;
+ *((*ptr)++) = (char)c;
return 0;
}
@@ -1342,10 +1342,10 @@
int16_t i16 = (int16_t)l;
memcpy(d, &i16, 2);
} else if (type == GD_INT32) {
- int16_t i32 = (int32_t)l;
+ int32_t i32 = (int32_t)l;
memcpy(d, &i32, 4);
} else if (type == GD_INT64) {
- int16_t i64 = (int64_t)l;
+ int64_t i64 = (int64_t)l;
memcpy(d, &i64, 8);
}
} else {
@@ -1357,10 +1357,10 @@
uint16_t u16 = (uint16_t)u;
memcpy(d, &u16, 2);
} else if (type == GD_INT32) {
- uint16_t u32 = (uint32_t)u;
+ uint32_t u32 = (uint32_t)u;
memcpy(d, &u32, 4);
} else if (type == GD_INT64) {
- uint16_t u64 = (uint64_t)u;
+ uint64_t u64 = (uint64_t)u;
memcpy(d, &u64, 8);
}
}
Modified: trunk/defile/lib/defile.h
===================================================================
--- trunk/defile/lib/defile.h 2012-08-14 20:26:01 UTC (rev 757)
+++ trunk/defile/lib/defile.h 2012-08-14 22:27:24 UTC (rev 758)
@@ -22,6 +22,9 @@
#ifndef DEFILE_H
#define DEFILE_H
+#ifndef GD_64BIT_API
+#define GD_64BIT_API
+#endif
#include <getdata.h>
/* command line options */
Modified: trunk/defile/lib/internal.h
===================================================================
--- trunk/defile/lib/internal.h 2012-08-14 20:26:01 UTC (rev 757)
+++ trunk/defile/lib/internal.h 2012-08-14 22:27:24 UTC (rev 758)
@@ -111,14 +111,14 @@
/* internal framedef */
struct df_infdef_field {
int index;
- off_t offset;
+ long long offset;
unsigned int spf;
size_t cadence;
size_t framesize;
};
struct df_infdef {
- off_t framesize;
+ long long framesize;
int n_fields;
struct df_infdef_field *field;
};
@@ -150,7 +150,7 @@
/* rate tracking */
double rate, tc;
- off_t wpartial, rpartial;
+ long long wpartial, rpartial;
long long nwrote, nread;
long long nframes;
@@ -168,7 +168,7 @@
int nfd;
struct df_infdef *fd;
- off_t rframesize, wframesize;
+ long long rframesize, wframesize;
int ref_ind;
Modified: trunk/defile/lib/libdefile.c
===================================================================
--- trunk/defile/lib/libdefile.c 2012-08-14 20:26:01 UTC (rev 757)
+++ trunk/defile/lib/libdefile.c 2012-08-14 22:27:24 UTC (rev 758)
@@ -555,7 +555,7 @@
if (fd->field[i].offset + (fd->field[i].spf - 1) * c + z > fd->framesize) {
fprintf(stderr, "libdefile: input error: frame definition error: "
- "data extends beyond end of frame (%zu > %zu)\n",
+ "data extends beyond end of frame (%llu > %llu)\n",
fd->field[i].offset + (fd->field[i].spf - 1) * c + z, fd->framesize);
return DF_INPUT;
}
@@ -770,7 +770,7 @@
pthread_mutex_unlock(&config_mx);
if (offset > 0)
for (i = 0; i < df->nraw; ++i)
- if (gd_seek(df->D, df->raw[i].name, offset, 0,
+ if (gd_seek64(df->D, df->raw[i].name, offset, 0,
GD_SEEK_SET | GD_SEEK_WRITE) < 0)
{
return DF_OUTPUT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|