diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-04 16:13:21 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2013-09-04 16:13:21 +0000 |
commit | a194122be492fbddd8748fe323a648434a866c36 (patch) | |
tree | f39293588b7922faa40f0c6b985a031f8f5cf0ae /girepository/cmph/bdz_ph.c | |
parent | 8a2a9f9db169eaaf2a7eede18e0ceba0af44345f (diff) | |
parent | 85d02d59f101f9eb37829b16a81890ef9801824a (diff) | |
download | gobject-introspection-a194122be492fbddd8748fe323a648434a866c36.tar.gz |
merge with GOBJECT_INTROSPECTION_1_37_6baserock/jonathan/fix-giscanner
Diffstat (limited to 'girepository/cmph/bdz_ph.c')
-rwxr-xr-x | girepository/cmph/bdz_ph.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/girepository/cmph/bdz_ph.c b/girepository/cmph/bdz_ph.c index 2e986071..2095f116 100755 --- a/girepository/cmph/bdz_ph.c +++ b/girepository/cmph/bdz_ph.c @@ -452,6 +452,10 @@ int bdz_ph_dump(cmph_t *mphf, FILE *fd) cmph_uint32 sizeg = 0; register size_t nbytes; bdz_ph_data_t *data = (bdz_ph_data_t *)mphf->data; +#ifdef DEBUG + cmph_uint32 i; +#endif + __cmph_dump(mphf, fd); hash_state_dump(data->hl, &buf, &buflen); @@ -466,12 +470,11 @@ int bdz_ph_dump(cmph_t *mphf, FILE *fd) sizeg = (cmph_uint32)ceil(data->n/5.0); nbytes = fwrite(data->g, sizeof(cmph_uint8)*sizeg, (size_t)1, fd); - if (nbytes == 0 && ferror(fd)) { + if (nbytes == 0 && ferror(fd)) { fprintf(stderr, "ERROR: %s\n", strerror(errno)); return 0; } #ifdef DEBUG - cmph_uint32 i; fprintf(stderr, "G: "); for (i = 0; i < data->n; ++i) fprintf(stderr, "%u ", GETVALUE(data->g, i)); fprintf(stderr, "\n"); @@ -506,7 +509,7 @@ void bdz_ph_load(FILE *f, cmph_t *mphf) bdz_ph->g = (cmph_uint8 *)calloc((size_t)sizeg, sizeof(cmph_uint8)); nbytes = fread(bdz_ph->g, sizeg*sizeof(cmph_uint8), (size_t)1, f); - if (nbytes == 0 && ferror(f)) { + if (nbytes == 0 && ferror(f)) { fprintf(stderr, "ERROR: %s\n", strerror(errno)); } return; @@ -556,6 +559,7 @@ void bdz_ph_pack(cmph_t *mphf, void *packed_mphf) { bdz_ph_data_t *data = (bdz_ph_data_t *)mphf->data; cmph_uint8 * ptr = packed_mphf; + cmph_uint32 sizeg; // packing hl type CMPH_HASH hl_type = hash_get_type(data->hl); @@ -571,7 +575,7 @@ void bdz_ph_pack(cmph_t *mphf, void *packed_mphf) ptr += sizeof(data->r); // packing g - cmph_uint32 sizeg = (cmph_uint32)ceil(data->n/5.0); + sizeg = (cmph_uint32)ceil(data->n/5.0); memcpy(ptr, data->g, sizeof(cmph_uint8)*sizeg); } |