diff --git a/hdf/src/hchunks.c b/hdf/src/hchunks.c index 7a6979b05a..02eed673ce 100644 --- a/hdf/src/hchunks.c +++ b/hdf/src/hchunks.c @@ -247,16 +247,6 @@ LOCAL ROUTINES -GeorgeV - 9/3/96 */ -/* For debugging */ -/* -#define CHK_DEBUG_1 -#define CHK_DEBUG_2 -#define CHK_DEBUG_3 -#define CHK_DEBUG_4 -#define CHK_DEBUG_5 -#define CHK_DEBUG_10 -*/ - /* For Statistics from the chunk cache. Note that 'mache.c' must be compiled with -DSTATISTICS */ /* @@ -466,7 +456,7 @@ create_dim_recs(DIM_REC **dptr, /* OUT: dimension record pointers */ (*sbi)[i] = 0; (*spb)[i] = 0; (*sui)[i] = 0; - } /* end for i */ + } done: if (ret_value == FAIL) { /* Error condition cleanup */ @@ -503,27 +493,14 @@ update_chunk_indices_seek(int32 sloc, /* IN: physical Seek loc in element /* adjust physical seek->logical seek by using number type size */ stmp = sloc / nt_size; -#ifdef CHK_DEBUG_1 - printf("ucis: sloc=%d, stmp=%d \n", sloc, stmp); -#endif + for (i = ndims - 1; i >= 0; i--) { /* Calculate which chunk index in chunk representation */ sbi[i] = (int32)((stmp % ddims[i].dim_length) / ddims[i].chunk_length); /* calculate starting position in the chunk itself */ spb[i] = (int32)((stmp % ddims[i].dim_length) % ddims[i].chunk_length); stmp = stmp / ddims[i].dim_length; - } /* end for i */ -#ifdef CHK_DEBUG_1 - printf("ucis: chunk_array =("); - for (i = 0; i < ndims; i++) - printf("%d%s", sbi[i], i != ndims - 1 ? "," : NULL); - printf(")\n"); - - printf("ucis: chunk_pos_array =("); - for (i = 0; i < ndims; i++) - printf("%d%s", spb[i], i != ndims - 1 ? "," : NULL); - printf(")\n"); -#endif + } } /* update_chunk_indices_seek()*/ /* ------------------------------------------------------------------------- @@ -559,12 +536,6 @@ compute_chunk_to_array(int32 *chunk_indices, /* IN: chunk indices */ array_indices[j] += chunk_array_ind[j]; } -#ifdef CHK_DEBUG_1 - printf("ccta: array_indices:("); - for (j = 0; j < ndims; j++) - printf("%d%s", array_indices[j], j != ndims - 1 ? "," : NULL); - printf(")\n"); -#endif } /* compute_chunk_to_array() */ /* ------------------------------------------------------------------------- @@ -664,14 +635,8 @@ update_seek_pos_chunk(int32 chunk_seek, /* IN: physical seek pos in chunk */ /* calculate starting position in the chunk itself */ spb[i] = (int32)(stmp % ddims[i].chunk_length); stmp = stmp / ddims[i].chunk_length; - } /* end for i */ + } -#ifdef CHK_DEBUG_1 - printf("uspc: spb[] =("); - for (i = 0; i < ndims; i++) - printf("%d%s", spb[i], i != ndims - 1 ? "," : NULL); - printf(")\n"); -#endif } /* update_seek_pos_chunk() */ /* ------------------------------------------------------------------------- @@ -1158,10 +1123,6 @@ HMCIstaccess(accrec_t *access_rec, /* IN: access record to fill in */ /* verify class and version */ sprintf(v_class, "%s%d", _HDF_CHK_TBL_CLASS, _HDF_CHK_TBL_CLASS_VER); if (strncmp(class, v_class, strlen(v_class)) != 0) { -#ifdef CHK_DEBUG_2 - fprintf(stderr, " error, wrong class=%s, %d \n", class, strlen(class)); - fprintf(stderr, " v_class=%s, %d \n", v_class, strlen(v_class)); -#endif HGOTO_ERROR(DFE_INTERNAL, FAIL); } @@ -1211,13 +1172,6 @@ HMCIstaccess(accrec_t *access_rec, /* IN: access record to fill in */ pntr += sizeof(int32); } -#ifdef CHK_DEBUG_2 - printf(" chkptr->origin = ("); - for (k = 0; k < info->ndims; k++) - printf("%d%s", chkptr->origin[k], k != info->ndims - 1 ? "," : NULL); - printf("), "); -#endif - /* Copy tag next. Note: Verification of tag as DTAG_CHUNK is done in HMCPchunkread() before the chunk object is read. @@ -1226,15 +1180,10 @@ HMCIstaccess(accrec_t *access_rec, /* IN: access record to fill in */ */ memcpy(&chkptr->chk_tag, pntr, sizeof(uint16)); pntr += sizeof(uint16); -#ifdef CHK_DEBUG_2 - printf(" chktpr->chk_tag=%d, ", chkptr->chk_tag); -#endif + /* Copy ref last */ memcpy(&chkptr->chk_ref, pntr, sizeof(uint16)); -#ifdef CHK_DEBUG_2 - printf(" chktpr->chk_ref=%d, ", chkptr->chk_ref); - printf("\n"); -#endif + /* now compute chunk number from origin */ calculate_chunk_num(chk_key, info->ndims, chkptr->origin, info->ddims); @@ -1532,10 +1481,6 @@ HMCcreate(int32 file_id, /* IN: file to put chunked element in */ /* get tag of Vdata */ info->chktbl_tag = (uint16)VSQuerytag(info->aid); -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCcreate: info->chktbl_tag =%d, info->chktbl_ref=%d \n", info->chktbl_tag, - info->chktbl_ref); -#endif /* Define fields of chunk table i.e. Vdata */ /* Define origin - order based on number of dims */ @@ -1611,15 +1556,7 @@ HMCcreate(int32 file_id, /* IN: file to put chunked element in */ /* compute logical element length */ data_len *= info->ddims[i].dim_length; -#ifdef CHK_DEBUG_2 - printf("HMCcreate: dim[%d].dim_length=%d,", i, info->ddims[i].dim_length); - printf("dim[%d].chunk_length=%d,", i, info->ddims[i].chunk_length); - printf("dim[%d].num_chunks=%d \n", i, info->ddims[i].num_chunks); -#endif } /* end for ndims */ -#ifdef CHK_DEBUG_2 - printf("\n"); -#endif /* Make Vdata appendable with linked block table size of 'npages' if less than 128 and greater than 16. @@ -1748,10 +1685,7 @@ HMCcreate(int32 file_id, /* IN: file to put chunked element in */ if (HTPendaccess(data_id) == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); } -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCcreate: special_tag =%d, ref=%d \n", special_tag, ref); - fprintf(stderr, "HMCcreate: dd_aid =%d, data_id=%d \n", dd_aid, data_id); -#endif + /* update access record and file record */ if ((access_rec->ddid = HTPselect(file_rec, special_tag, ref)) == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); @@ -1766,9 +1700,6 @@ HMCcreate(int32 file_id, /* IN: file to put chunked element in */ file_rec->attach++; -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCcreate: access_rec->ddid =%d \n", access_rec->ddid); -#endif /* register this valid access record for the chunked element */ access_aid = HAregister_atom(AIDGROUP, access_rec); @@ -2488,19 +2419,11 @@ HMCsetMaxcache(int32 access_id, /* IN: access aid to mess with */ (void)flags; -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCsetMaxcache: access_id =%d \n", access_id); -#endif /* Check args */ access_rec = HAatom_object(access_id); if (access_rec == NULL || maxcache < 1) HGOTO_ERROR(DFE_ARGS, FAIL); -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCsetMaxcache: access_rec->special =%d \n", access_rec->special); - fprintf(stderr, "HMCsetMaxcache: access_rec->ddid =%d \n", access_rec->ddid); -#endif - /* since this routine can be called by the user, need to check if this access id is special CHUNKED */ if (access_rec->special == SPECIAL_CHUNKED) { @@ -2584,9 +2507,6 @@ HMCPseek(accrec_t *access_rec, /* IN: access record to mess with */ chunkinfo_t *info = NULL; /* information for the chunked elt */ int32 ret_value = SUCCEED; -#ifdef CHK_DEBUG_3 - printf("HMCPseek called with offset %d \n", offset); -#endif /* Check args */ if (access_rec == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -2616,10 +2536,6 @@ HMCPseek(accrec_t *access_rec, /* IN: access record to mess with */ /* set position in access record */ access_rec->posn = offset; -#ifdef CHK_DEBUG_3 - printf("HMCPseek new user seek position in element is %d \n", offset); -#endif - done: return ret_value; } /* HMCPseek */ @@ -2665,9 +2581,6 @@ HMCPchunkread(void *cookie, /* IN: access record to mess with */ bytes_read = 0; read_len = (info->chunk_size * info->nt_size); -#ifdef CHK_DEBUG_3 - printf("HMCPchunkread called with chunk %d \n", chunk_num); -#endif /* find chunk record in TBBT */ if ((entry = (tbbtdfind(info->chk_tree, &chunk_num, NULL))) == NULL) { /* does not exist */ /* calculate number of fill value items to fill buffer with */ @@ -2727,9 +2640,6 @@ HMCPchunkread(void *cookie, /* IN: access record to mess with */ Hendaccess(chk_id); } /* end if */ -#ifdef CHK_DEBUG_3 - printf("HMCPchunkread exit with ret_value= %d \n", ret_value); -#endif return ret_value; } /* HMCPchunkread() */ @@ -2767,9 +2677,6 @@ HMCreadChunk(int32 access_id, /* IN: access aid to mess with */ int32 ret_value = SUCCEED; intn i; -#ifdef CHK_DEBUG_5 - printf("HMCreadChunk: entered \n"); -#endif /* Check args */ access_rec = HAatom_object(access_id); if (access_rec == NULL) @@ -2804,18 +2711,9 @@ HMCreadChunk(int32 access_id, /* IN: access aid to mess with */ info->seek_pos_chunk[i] = 0; } -#ifdef CHK_DEBUG_5 - printf(" Seek start(in chunk array):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_chunk_indices[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif /* calculate chunk number from origin */ calculate_chunk_num(&chunk_num, info->ndims, origin, info->ddims); -#ifdef CHK_DEBUG_5 - printf("HMCreadChunk called with chunk %d \n", chunk_num); -#endif /* currently get chunk data from cache based on chunk number Note the cache deals with objects starting from 1 not 0 */ if ((chk_data = mcache_get(info->chk_cache, /* cache handle */ @@ -2837,10 +2735,6 @@ HMCreadChunk(int32 access_id, /* IN: access aid to mess with */ /* adjust number of bytes already read */ bytes_read = read_len; -#ifdef CHK_DEBUG_5 - printf("HMCreadChunk: read %d bytes already\n", bytes_read); -#endif - /*update chunk seek indices after reading chunk */ update_seek_pos_chunk(bytes_read, info->ndims, info->nt_size, info->seek_pos_chunk, info->ddims); @@ -2852,28 +2746,15 @@ HMCreadChunk(int32 access_id, /* IN: access aid to mess with */ compute_array_to_seek(&relative_posn, info->seek_user_indices, info->nt_size, info->ndims, info->ddims); -#ifdef CHK_DEBUG_5 - printf("HMCreadChunk: new position in element is %d\n", relative_posn); -#endif /* update access record with bytes read */ access_rec->posn = relative_posn; -#ifdef CHK_DEBUG_5 - /* for info only */ - compute_chunk_to_seek(&relative_posn, info->ndims, info->nt_size, info->seek_chunk_indices, - info->seek_pos_chunk, info->ddims, info->chunk_size); - printf("HMCreadChunk: new chunk seek position in element is %d\n", relative_posn); -#endif - ret_value = bytes_read; } else /* not special chunked element */ ret_value = FAIL; done: -#ifdef CHK_DEBUG_5 - printf("HMCreadChunk: exited, ret=%d \n", ret_value); -#endif return ret_value; } /* HMCreadChunk() */ @@ -2907,23 +2788,12 @@ HMCPread(accrec_t *access_rec, /* IN: access record to mess with */ int32 chunk_num = 0; /* next chunk number */ void *chk_data = NULL; /* chunk data */ uint8 *chk_dptr = NULL; /* pointer to chunk data */ -#ifdef CHK_DEBUG_3 - int i; -#endif - int32 ret_value = SUCCEED; + int32 ret_value = SUCCEED; -#ifdef CHK_DEBUG_3 - printf("HMCPread called with length %d \n", length); -#endif /* Check args */ if (access_rec == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCread: access_rec->special =%d \n", access_rec->special); - fprintf(stderr, "HMCread: access_rec->ddid =%d \n", access_rec->ddid); -#endif - /* set inputs */ info = (chunkinfo_t *)(access_rec->special_info); relative_posn = access_rec->posn; /* current seek position in element */ @@ -2947,19 +2817,6 @@ HMCPread(accrec_t *access_rec, /* IN: access record to mess with */ bytes_read = 0; read_len = length; while (bytes_read < read_len) { - /* for debugging */ -#ifdef CHK_DEBUG_3 - int i; - printf(" Seek start(in chunk array):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_chunk_indices[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); - printf(" Seek start(within the chunk):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_pos_chunk[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif - /* calculate chunk to retrieve on this pass */ calculate_chunk_num(&chunk_num, info->ndims, info->seek_chunk_indices, info->ddims); @@ -2989,18 +2846,9 @@ HMCPread(accrec_t *access_rec, /* IN: access record to mess with */ chk_dptr += read_seek; /* move to correct position in chunk */ -#ifdef CHK_DEBUG_3 - printf(" read pos in chunk(%d) is %d bytes\n", chunk_num, read_seek); -#endif /* copy data from chunk to users buffer */ memcpy(bptr, chk_dptr, chunk_size); -#ifdef CHK_DEBUG_10 - printf(" chk_dptr={"); - for (i = 0; i < chunk_size; i++) - printf("%d,", (uint8) * ((uint8 *)(chk_dptr) + i)); - printf("}\n"); -#endif /* put chunk back to cache */ if (mcache_put(info->chk_cache, /* cache handle */ chk_data, /* whole data chunk */ @@ -3013,15 +2861,10 @@ HMCPread(accrec_t *access_rec, /* IN: access record to mess with */ /* adjust number of bytes already read */ bytes_read += chunk_size; -#ifdef CHK_DEBUG_3 - printf(" read %d bytes already\n", bytes_read); -#endif /* update relative position i.e. user element seek position with chunk size written */ relative_posn += chunk_size; -#ifdef CHK_DEBUG_3 - printf(" relative_posn = %d bytes \n", relative_posn); -#endif + /* i.e calculate chunk indices given seek location this will update the proper arrays in the special info struct */ update_chunk_indices_seek(relative_posn, info->ndims, info->nt_size, info->seek_chunk_indices, @@ -3033,12 +2876,6 @@ HMCPread(accrec_t *access_rec, /* IN: access record to mess with */ ret_value = bytes_read; -#ifdef CHK_DEBUG_10 - printf(" datap={"); - for (i = 0; i < length; i++) - printf("%d,", (uint8) * ((uint8 *)(datap) + i)); - printf("}\n"); -#endif done: return ret_value; } /* HMCPread */ @@ -3086,9 +2923,6 @@ HMCPchunkwrite(void *cookie, /* IN: access record to mess with */ bytes_written = 0; bptr = datap; -#ifdef CHK_DEBUG_4 - printf("HMCPchunkwrite called with chunk %d \n", chunk_num); -#endif /* find chunk record in TBBT */ if ((entry = (tbbtdfind(info->chk_tree, &chunk_num, NULL))) == NULL) HE_REPORT_GOTO("failed to find chunk record", FAIL); @@ -3110,14 +2944,6 @@ HMCPchunkwrite(void *cookie, /* IN: access record to mess with */ /* Initialize chunk record */ chkptr->chk_tag = DFTAG_CHUNK; chkptr->chk_ref = Htagnewref(access_rec->file_id, DFTAG_CHUNK); -#ifdef CHK_DEBUG_4 - printf(" chktpr->chk_tag=%d, ", chkptr->chk_tag); - printf(" chktpr->chk_ref=%d, ", chkptr->chk_ref); - printf(" chkptr->origin = ("); - for (k = 0; k < info->ndims; k++) - printf("%d%s", chkptr->origin[k], k != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif if (chkptr->chk_ref == 0) { /* out of ref numbers -- extremely fatal */ @@ -3185,9 +3011,6 @@ HMCPchunkwrite(void *cookie, /* IN: access record to mess with */ free(v_data); -#ifdef CHK_DEBUG_4 - printf("HMCPchunkwrite exited with ret_value %d \n", ret_value); -#endif return ret_value; } /* HMCPchunkwrite() */ @@ -3228,9 +3051,6 @@ HMCwriteChunk(int32 access_id, /* IN: access aid to mess with */ intn k; /* loop index */ intn i; -#ifdef CHK_DEBUG_4 - printf("HMCwriteChunk: entered \n"); -#endif /* Check args */ access_rec = HAatom_object(access_id); if (access_rec == NULL) @@ -3265,18 +3085,9 @@ HMCwriteChunk(int32 access_id, /* IN: access aid to mess with */ info->seek_pos_chunk[i] = 0; } -#ifdef CHK_DEBUG_4 - printf(" Seek start(in chunk array):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_chunk_indices[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif /* calculate chunk number from origin */ calculate_chunk_num(&chunk_num, info->ndims, origin, info->ddims); -#ifdef CHK_DEBUG_4 - printf("HMCwriteChunk called with chunk %d \n", chunk_num); -#endif /* find chunk record in TBBT */ if (tbbtdfind(info->chk_tree, &chunk_num, NULL) == NULL) { /* not in tree */ @@ -3296,20 +3107,12 @@ HMCwriteChunk(int32 access_id, /* IN: access aid to mess with */ /* Initialize chunk record */ chkptr->chk_tag = DFTAG_NULL; chkptr->chk_ref = 0; -#ifdef CHK_DEBUG_4 - printf("HMCwriteChunk: chktpr->chk_tag=%d, ", chkptr->chk_tag); - printf(" chktpr->chk_ref=%d \n", chkptr->chk_ref); -#endif + /* Initialize chunk origins */ for (k = 0; k < info->ndims; k++) { chkptr->origin[k] = origin[k]; -#ifdef CHK_DEBUG_4 - printf(" chktpr->origin[%d]=%d, ", k, chkptr->origin[k]); -#endif } -#ifdef CHK_DEBUG_4 - printf("\n"); -#endif + /* set chunk record number to next Vdata record number */ chkptr->chk_vnum = info->num_recs++; @@ -3360,20 +3163,9 @@ HMCwriteChunk(int32 access_id, /* IN: access aid to mess with */ compute_array_to_seek(&relative_posn, info->seek_user_indices, info->nt_size, info->ndims, info->ddims); -#ifdef CHK_DEBUG_4 - printf(" new user seek position in element is %d\n", relative_posn); -#endif /* update access record with bytes written */ access_rec->posn = relative_posn; -#ifdef CHK_DEBUG_4 - /* for info only */ - compute_chunk_to_seek(&relative_posn, info->ndims, info->nt_size, info->seek_chunk_indices, - info->seek_pos_chunk, info->ddims, info->chunk_size); - - printf(" new chunk seek position in element is %d\n", relative_posn); -#endif - ret_value = bytes_written; } else /* not special chunked element */ @@ -3389,9 +3181,6 @@ HMCwriteChunk(int32 access_id, /* IN: access aid to mess with */ free(chk_key); } -#ifdef CHK_DEBUG_4 - printf("HMCwriteChunk: exited, ret=%d \n", ret_value); -#endif return ret_value; } /* HMCwriteChunk */ @@ -3432,13 +3221,7 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ int32 chunk_num = 0; /* chunk number */ int32 ret_value = SUCCEED; intn k; /* loop index */ -#ifdef CHK_DEBUG_4 - intn i; -#endif -#ifdef CHK_DEBUG_4 - printf("HMCPwrite called with length %d \n", length); -#endif /* Check args */ if (access_rec == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -3463,17 +3246,6 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ bytes_written = 0; bptr = datap; while (bytes_written < write_len) { - /* for debugging */ -#ifdef CHK_DEBUG_4 - printf("Seek start(in chunk array):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_chunk_indices[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); - printf(" Seek start(within the chunk):("); - for (i = 0; i < info->ndims; i++) - printf("%d%s", info->seek_pos_chunk[i], i != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif /* calculate chunk to retrieve */ calculate_chunk_num(&chunk_num, info->ndims, info->seek_chunk_indices, info->ddims); @@ -3482,10 +3254,6 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ calculate_chunk_for_chunk(&chunk_size, info->ndims, info->nt_size, write_len, bytes_written, info->seek_chunk_indices, info->seek_pos_chunk, info->ddims); -#ifdef CHK_DEBUG_4 - printf(" writing chunk(%d) of %d bytes ->\n", chunk_num, chunk_size); -#endif - /* find chunk record in TBBT */ if (tbbtdfind(info->chk_tree, &chunk_num, NULL) == NULL) { /* not in tree */ @@ -3505,19 +3273,11 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ /* Initialize chunk record */ chkptr->chk_tag = DFTAG_NULL; chkptr->chk_ref = 0; -#ifdef CHK_DEBUG_4 - printf(" chktpr->chk_tag=%d, ", chkptr->chk_tag); - printf(" chktpr->chk_ref=%d, ", chkptr->chk_ref); -#endif + /* Initialize chunk origins */ for (k = 0; k < info->ndims; k++) chkptr->origin[k] = info->seek_chunk_indices[k]; -#ifdef CHK_DEBUG_4 - printf(" chkptr->origin = ("); - for (k = 0; k < info->ndims; k++) - printf("%d%s", chkptr->origin[k], k != info->ndims - 1 ? "," : NULL); - printf(")\n"); -#endif + /* set chunk record number to next Vdata record number */ chkptr->chk_vnum = info->num_recs++; @@ -3537,9 +3297,7 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ numbers and not Vdata record numbers. This would reduce some overhead in the number of chunks dealt with in the cache */ -#ifdef CHK_DEBUG_4 - printf(" getting chunk %d from cache\n", chunk_num); -#endif + /* get chunk data from cache based on chunk number chunks in the cache start from 1 not 0 */ if ((chk_data = mcache_get(info->chk_cache, /* cache handle */ @@ -3554,18 +3312,9 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ chk_dptr += write_seek; /* move to correct position in chunk */ -#ifdef CHK_DEBUG_4 - fprintf(stderr, " write pos in chunk (%d) is %d bytes\n", chunk_num, write_seek); -#endif /* copy data from users buffer to chunk */ memcpy(chk_dptr, bptr, chunk_size); -#ifdef CHK_DEBUG_10 - printf(" chk_dptr={"); - for (i = 0; i < chunk_size; i++) - printf("%d,", (uint8) * ((uint8 *)(chk_dptr) + i)); - printf("}\n"); -#endif /* put chunk back to cache as DIRTY */ if (mcache_put(info->chk_cache, /* cache handle */ chk_data, /* whole data chunk */ @@ -3578,15 +3327,10 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ /* adjust number of bytes already written */ bytes_written += chunk_size; -#ifdef CHK_DEBUG_4 - printf(" written %d bytes already -> \n", bytes_written); -#endif /* update relative position i.e. user element seek position with chunk size written */ relative_posn += chunk_size; -#ifdef CHK_DEBUG_4 - printf(" relative_posn = %d bytes \n", relative_posn); -#endif + /* i.e calculate chunk indices given seek location this will update the proper arrays in the special info struct */ update_chunk_indices_seek(relative_posn, info->ndims, info->nt_size, info->seek_chunk_indices, @@ -3608,9 +3352,6 @@ HMCPwrite(accrec_t *access_rec, /* IN: access record to mess with */ free(chk_key); } -#ifdef CHK_DEBUG_4 - printf("HMCPwrite: exited, ret=%d \n", ret_value); -#endif return ret_value; } /* HMCPwrite */ @@ -3651,10 +3392,6 @@ HMCPcloseAID(accrec_t *access_rec /* IN: access record of file to close */) /* detach the special information record. If no more references to that, free the record */ if (--(info->attached) == 0) { -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCPcloseAID: info->attached =%d, last one \n", info->attached); - -#endif if (info->chk_cache != NULL) { /* Sync chunk cache */ mcache_sync(info->chk_cache); @@ -3694,12 +3431,6 @@ HMCPcloseAID(accrec_t *access_rec /* IN: access record of file to close */) free(info); access_rec->special_info = NULL; } /* attached to info */ - else { -#ifdef CHK_DEBUG_2 - fprintf(stderr, "HMCPcloseAID: info->attached =%d \n", info->attached); - -#endif - } done: return ret_value; diff --git a/hdf/src/hfiledd.c b/hdf/src/hfiledd.c index d7e75f5383..3128e26ecf 100644 --- a/hdf/src/hfiledd.c +++ b/hdf/src/hfiledd.c @@ -1237,7 +1237,7 @@ Hdeldd(int32 file_id, uint16 tag, uint16 ref) return ret_value; } /* end Hdeldd */ -#ifdef DEBUGGING +#ifdef DD_DEBUG /*-------------------------------------------------------------------------- NAME HTPdump_dds -- Dump out the dd information for a file @@ -1337,7 +1337,7 @@ HTPdump_dds(int32 file_id, FILE *fout) done: return ret_value; } /* HTPdump_dds */ -#endif /* DEBUGGING */ +#endif /* DD_DEBUG */ /* Private, static, internal routines. Do not call from outside this module */ diff --git a/hdf/src/mcache.c b/hdf/src/mcache.c index 136cfd1df3..cb7e742b43 100644 --- a/hdf/src/mcache.c +++ b/hdf/src/mcache.c @@ -47,10 +47,6 @@ * -georgev */ -/* for debugging */ -/* -#define MCACHE_DEBUG -*/ /* #define STATISTICS */ @@ -258,19 +254,11 @@ mcache_open(void *key, /* IN: byte string used as handle to share buffers free(lp); } } /* end for entry */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_open: ERROR \n"); -#endif + mp = NULL; /* return value */ - } /* end error cleanup */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_open: mp->pagesize=%lu\n", mp->pagesize); - (void)fprintf(stderr, "mcache_open: mp->maxcache=%u\n", mp->maxcache); - (void)fprintf(stderr, "mcache_open: mp->npages=%u\n", mp->npages); - (void)fprintf(stderr, "mcache_open: flags=%u\n", flags); + } #ifdef STATISTICS - (void)fprintf(stderr, "mcache_open: mp->listalloc=%lu\n", mp->listalloc); -#endif + fprintf(stderr, "mcache_open: mp->listalloc=%lu\n", mp->listalloc); #endif return mp; @@ -326,9 +314,6 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ (void)flags; -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_get: entering \n"); -#endif /* check inputs */ if (mp == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -344,12 +329,6 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ /* Check for a page that is cached. */ if ((bp = mcache_look(mp, pgno)) != NULL) { -#ifdef MCACHE_DEBUG - if (bp->flags & MCACHE_PINNED) { - (void)fprintf(stderr, "mcache_get: page %d already pinned\n", bp->pgno); - abort(); - } -#endif /* * Move the page to the head of the hash chain and the tail * of the lru chain. @@ -362,9 +341,6 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ /* Return a pinned page. */ bp->flags |= MCACHE_PINNED; -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_get: getting cached bp->pgno=%d,npages=%d\n", bp->pgno, mp->npages); -#endif /* update this page reference */ lhead = &mp->lhqh[HASHKEY(bp->pgno)]; for (lp = lhead->cqh_first; lp != (void *)lhead; lp = lp->hl.cqe_next) @@ -381,10 +357,6 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ goto done; } /* end if bp */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_get: NOT cached page\n"); -#endif - /* Page not cached so * Get a page from the cache to use or create one. */ if ((bp = mcache_bkt(mp)) == NULL) @@ -417,12 +389,9 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ lp->elemhit = 1; #endif H4_CIRCLEQ_INSERT_HEAD(lhead, lp, hl); /* add to list */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_get: skipping reading in page=%u\n", pgno); -#endif - } /*end if !list_hit */ - else { /* list hit, need to read page */ - lp->eflags = ELEM_READ; /* Indicate we are reading this page */ + } /*end if !list_hit */ + else { /* list hit, need to read page */ + lp->eflags = ELEM_READ; /* Indicate we are reading this page */ #ifdef STATISTICS ++mp->pageread; @@ -461,15 +430,9 @@ mcache_get(MCACHE *mp, /* IN: MCACHE cookie */ done: if (ret_value == RET_ERROR) { /* error cleanup */ -#ifdef MCACHE_DEBUG - fprintf(stderr, "mcache_get: Error exiting \n"); -#endif free(lp); return NULL; } -#ifdef MCACHE_DEBUG - fprintf(stderr, "mcache_get: Exiting \n"); -#endif return bp->page; } /* mcache_get() */ @@ -503,13 +466,7 @@ mcache_put(MCACHE *mp, /* IN: MCACHE cookie */ #endif /* get pointer to bucket element */ bp = (BKT *)((char *)page - sizeof(BKT)); -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_put: putting page=%d\n", bp->pgno); - if (!(bp->flags & MCACHE_PINNED)) { - (void)fprintf(stderr, "mcache_put: page %d not pinned\n", bp->pgno); - abort(); - } -#endif + /* Unpin the page and mark it appropriately */ bp->flags &= ~MCACHE_PINNED; bp->flags |= flags & MCACHE_DIRTY; @@ -551,9 +508,6 @@ mcache_close(MCACHE *mp /* IN: MCACHE cookie */) intn ret_value = RET_SUCCESS; intn entry; /* index into hash table */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_close: entered \n"); -#endif /* check inputs */ if (mp == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -581,9 +535,6 @@ mcache_close(MCACHE *mp /* IN: MCACHE cookie */) /* Free the MCACHE cookie. */ free(mp); -#ifdef MCACHE_DEBUG - fprintf(stderr, "mcache_close: freed %d list elements\n\n", nelem); -#endif return ret_value; } /* mcache_close() */ @@ -603,9 +554,6 @@ mcache_sync(MCACHE *mp /* IN: MCACHE cookie */) BKT *bp = NULL; /* bucket element */ intn ret_value = RET_SUCCESS; -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "MCACHE_sync: entering \n"); -#endif /* check inputs */ if (mp == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -621,10 +569,6 @@ mcache_sync(MCACHE *mp /* IN: MCACHE cookie */) return ret_value; } -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_sync: exiting \n"); -#endif - return ret_value; } /* mcache_sync() */ @@ -676,14 +620,7 @@ mcache_bkt(MCACHE *mp /* IN: MCACHE cookie */) head = &mp->hqh[HASHKEY(bp->pgno)]; H4_CIRCLEQ_REMOVE(head, bp, hq); H4_CIRCLEQ_REMOVE(&mp->lqh, bp, q); -#ifdef MCACHE_DEBUG - { - void *spage; - spage = bp->page; - memset(bp, 0xff, sizeof(BKT) + mp->pagesize); - bp->page = spage; - } -#endif + /* done */ ret_value = RET_SUCCESS; goto done; @@ -696,10 +633,6 @@ mcache_bkt(MCACHE *mp /* IN: MCACHE cookie */) ++mp->pagealloc; #endif -#if defined(MCACHE_DEBUG) || defined(PURIFY) - memset(bp, 0xff, sizeof(BKT) + mp->pagesize); -#endif - /* set page ptr past bucket element section */ bp->page = (char *)bp + sizeof(BKT); ++mp->curcache; /* increase number of cached pages */ @@ -730,9 +663,7 @@ mcache_write(MCACHE *mp, /* IN: MCACHE cookie */ struct _lhqh *lhead = NULL; /* head of an entry in list hash chain */ L_ELEM *lp = NULL; intn ret_value = RET_SUCCESS; -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_write: entering \n"); -#endif + /* check inputs */ if (mp == NULL || bp == NULL) HGOTO_ERROR(DFE_ARGS, FAIL); @@ -769,24 +700,14 @@ mcache_write(MCACHE *mp, /* IN: MCACHE cookie */ goto done; } -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_write: npages=%u\n", mp->npages); -#endif - /* mark page as clean */ bp->flags &= ~MCACHE_DIRTY; done: if (ret_value == RET_ERROR) { /* error cleanup */ -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_write: error exiting\n"); -#endif return ret_value; } -#ifdef MCACHE_DEBUG - (void)fprintf(stderr, "mcache_write: exiting\n"); -#endif return ret_value; } /* mcache_write() */ diff --git a/hdf/src/mfan.c b/hdf/src/mfan.c index 16525b8e46..7ad3c9d5b5 100644 --- a/hdf/src/mfan.c +++ b/hdf/src/mfan.c @@ -921,9 +921,7 @@ ANIreadann(int32 ann_id, /* IN: annotation id (handle) */ /* first four bytes were tag/ref if data annotation, so they don't count */ if (ann_tag == DFTAG_DIL || ann_tag == DFTAG_DIA) ann_len -= 4; -#ifdef AN_DEBUG - printf("ANIreadann: from Hinquire, ann_len=%d, maxlen=%d\n", ann_len, maxlen); -#endif + /* Check length of space provided * if not enough space, truncate annotation * Labels need space for null terminator, Descriptions don't */ @@ -949,9 +947,7 @@ ANIreadann(int32 ann_id, /* IN: annotation id (handle) */ /* If Label need to NULL terminate string */ if (ann_tag == DFTAG_FID || ann_tag == DFTAG_DIL) ann[ann_len] = '\0'; -#ifdef AN_DEBUG - printf("ANIreadann: ann_len=%d, ann=%s\n", ann_len, ann); -#endif + /* Close access to annotation object */ if (FAIL != aid) { if (FAIL == Hendaccess(aid)) @@ -1084,9 +1080,6 @@ ANIwriteann(int32 ann_id, /* IN: annotation id */ if ((int32)FAIL == Hwrite(aid, (int32)4, datadi)) HE_REPORT_GOTO("Failed to write tag/ref of annotation", FAIL); -#ifdef AN_DEBUG - printf("ANIwriteann: ann_len=%d, ann=%s\n", ann_len, ann); -#endif /* then write the annotation itself */ if ((int32)FAIL == Hwrite(aid, ann_len, ann)) HE_REPORT_GOTO("Failed to write annotation", FAIL); @@ -1100,9 +1093,6 @@ ANIwriteann(int32 ann_id, /* IN: annotation id */ /* write out file label/description */ if (FAIL == Hputelement(file_id, ann_tag, ann_ref, (const uint8 *)ann, ann_len)) HE_REPORT_GOTO("Failed to write file annotation", FAIL); -#ifdef AN_DEBUG - printf("ANIwriteann: fann_len=%d, fann=%s\n", ann_len, ann); -#endif } done: diff --git a/hdf/src/mfgr.c b/hdf/src/mfgr.c index aa80364283..1f2bfa7fbe 100644 --- a/hdf/src/mfgr.c +++ b/hdf/src/mfgr.c @@ -4987,9 +4987,6 @@ GRPshutdown(void) /*====================== Chunking Routines ================================*/ -/* Debugging */ -/* #define CHK_DEBUG */ - /* NOTE: the definition of the union HDF_CHUNK_DEF can be found in hproto.h */ /****************************************************************************** @@ -5123,9 +5120,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ gr_info_t *gr_ptr; /* ptr to the file GR information for this image */ intn ret_value = SUCCEED; /* return value */ -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: called \n"); -#endif /* clear error stack and check validity of args */ HEclear(); @@ -5154,10 +5148,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ ri_ptr->img_ref = Htagnewref(hdf_file_id, ri_ptr->img_tag); } /* end if */ -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: ri_ptr->img_aid=%d \n", ri_ptr->img_aid); -#endif - /* Decide type of definition passed in */ switch (flags) { case HDF_CHUNK: /* case where chunk_def only has chunk lengths */ @@ -5239,10 +5229,7 @@ GRsetchunk(int32 riid, /* IN: raster access id */ ret_value = FAIL; goto done; } -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: cdims[%d]=%d \n", i, cdims[i]); - fflush(stderr); -#endif + /* Data distribution along dimensions * Check dimension length against chunk length */ if (i == 0) /* X */ @@ -5273,12 +5260,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ number of components times the number type */ chunk[0].nt_size = ri_ptr->img_dim.ncomps * DFKNTsize(ri_ptr->img_dim.nt); -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: datatype size =%d\n", - ri_ptr->img_dim.ncomps * DFKNTsize(ri_ptr->img_dim.nt)); - fflush(stderr); -#endif - /* allocate space for fill pixel */ if ((fill_pixel = malloc(pixel_disk_size)) == NULL) HGOTO_ERROR(DFE_NOSPACE, FAIL); @@ -5305,11 +5286,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ memset(fill_pixel, 0, pixel_disk_size); } /* end else */ -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: get ready to create\n"); - fprintf(stderr, "GRsetchunk: img_tag=%d, img_ref=%d\n", ri_ptr->img_tag, ri_ptr->img_ref); -#endif - /* check to see already special. Error if already special since doubly special elements are not yet handled. HMCcreate should catch this....*/ @@ -5322,10 +5298,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ (void *)fill_pixel, /* fill value */ (HCHUNK_DEF *)chunk /* chunk definition */); -#ifdef CHK_DEBUG - fprintf(stderr, "HMCcreate: ret_value =%d \n", ret_value); -#endif - /* check return */ if (ret_value != FAIL) { /* close old aid and set new one ..hmm......this is for the doubly special hack */ @@ -5338,10 +5310,6 @@ GRsetchunk(int32 riid, /* IN: raster access id */ ret_value = SUCCEED; /* re-set to successful */ } /* end if */ -#ifdef CHK_DEBUG - fprintf(stderr, "GRsetchunk: ri_ptr->img_aid =%d \n", ri_ptr->img_aid); -#endif - done: /* free fill value */ free(fill_pixel); @@ -5414,10 +5382,6 @@ GRgetchunkinfo(int32 riid, /* IN: sds access id */ else if (ri_ptr->img_aid == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); -#ifdef CHK_DEBUG - fprintf(stderr, "%s: ri_ptr->img_aid =%d \n", __func__, ri_ptr->img_aid); -#endif - /* inquire about element */ ret_value = Hinquire(ri_ptr->img_aid, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &special); if (ret_value != FAIL) { /* make sure it is chunked element */ @@ -5538,9 +5502,6 @@ GRwritechunk(int32 riid, /* IN: access aid to GR */ else if (ri_ptr->img_aid == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); -#ifdef CHK_DEBUG - fprintf(stderr, "%s: ri_ptr->img_aid =%d \n", __func__, ri_ptr->img_aid); -#endif comp_type = COMP_CODE_NONE; scheme = ri_ptr->img_dim.comp_tag; if (scheme == DFTAG_JPEG5 || scheme == DFTAG_GREYJPEG5 || scheme == DFTAG_JPEG || @@ -5733,10 +5694,6 @@ GRreadchunk(int32 riid, /* IN: access aid to GR */ else if (ri_ptr->img_aid == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); -#ifdef CHK_DEBUG - fprintf(stderr, "%s: ri_ptr->img_aid =%d \n", __func__, ri_ptr->img_aid); -#endif - comp_type = COMP_CODE_NONE; scheme = ri_ptr->img_dim.comp_tag; if (scheme == DFTAG_JPEG5 || scheme == DFTAG_GREYJPEG5 || scheme == DFTAG_JPEG || @@ -5944,10 +5901,6 @@ GRsetchunkcache(int32 riid, /* IN: access aid to mess with */ else if (ri_ptr->img_aid == FAIL) HGOTO_ERROR(DFE_INTERNAL, FAIL); -#ifdef CHK_DEBUG - fprintf(stderr, "%s: ri_ptr->img_aid =%d \n", __func__, ri_ptr->img_aid); -#endif - /* inquire about element */ ret_value = Hinquire(ri_ptr->img_aid, NULL, NULL, NULL, NULL, NULL, NULL, NULL, &special); if (ret_value != FAIL) { diff --git a/hdf/test/man.c b/hdf/test/man.c index 8caed67b88..48038021ab 100644 --- a/hdf/test/man.c +++ b/hdf/test/man.c @@ -162,10 +162,6 @@ check_fann_rewrite(const char *fname) ret = ANfileinfo(an_handle, &nflabs, &nfdescs, &nolabs, &nodescs); RESULT("Anfileinfo"); -#ifdef AN_DEBUG - printf("There Are Nflabs=%d, Nfdescs=%d, Nolabs=%d, Nodescs=%d \n", nflabs, nfdescs, nolabs, nodescs); -#endif - /* get first label */ ann_handle = ret = ANselect(an_handle, 0, AN_FILE_LABEL); RESULT("ANselect"); @@ -268,10 +264,6 @@ check_fann_rewrite(const char *fname) num_errs++; } -#ifdef AN_DEBUG - printf("found ann_len=%d, file label=%s\n", strlen(ann_label), ann_label); -#endif - /* Clean up */ free(ann_label); ann_label = NULL; @@ -325,10 +317,6 @@ check_fann(const char *fname) ret = ANfileinfo(an_handle, &nflabs, &nfdescs, &nolabs, &nodescs); RESULT("Anfileinfo"); -#ifdef AN_DEBUG - printf("There Are Nflabs=%d, Nfdescs=%d, Nolabs=%d, Nodescs=%d \n", nflabs, nfdescs, nolabs, nodescs); -#endif - /* read file labels */ for (i = 0; i < nflabs; i++) { /* select file label */ indx = i; @@ -391,10 +379,6 @@ check_fann(const char *fname) num_errs++; } -#ifdef AN_DEBUG - printf("found ann_len=%d, file label=%s\n", strlen(ann_label), ann_label); -#endif - free(ann_label); ann_label = NULL; } /* end for nflabs */ @@ -439,10 +423,6 @@ check_fann(const char *fname) num_errs++; } -#ifdef AN_DEBUG - printf("found ann_len=%d, file desc=%s\n", strlen(ann_desc), ann_desc); -#endif - free(ann_desc); ann_desc = NULL; } /* end for nfdescs */ @@ -494,23 +474,14 @@ check_lab_desc(const char *fname, uint16 tag, uint16 ref, const char *label[], c /* Get Info On Annotations In File */ ret = ANfileinfo(an_handle, &nflabs, &nfdescs, &nolabs, &nodescs); RESULT("Anfileinfo"); -#ifdef AN_DEBUG - printf("There Are Nflabs=%d, Nfdescs=%d, Nolabs=%d, Nodescs=%d \n", nflabs, nfdescs, nolabs, nodescs); -#endif /* Get number of label annotations with this tag/ref */ num_dlabels = ret = ANnumann(an_handle, AN_DATA_LABEL, tag, ref); RESULT("ANnumann"); -#ifdef AN_DEBUG - printf("there are %d data labels for tag=%d, ref=%d \n", num_dlabels, tag, ref); -#endif /* Get number of label descs with this tag/ref */ num_ddescs = ret = ANnumann(an_handle, AN_DATA_DESC, tag, ref); RESULT("ANnumann"); -#ifdef AN_DEBUG - printf("There Are %d Data Descriptions For Tag=%d, Ref=%d \n", num_ddescs, tag, ref); -#endif /* allocate space for list of label annotation id's with this tag/ref */ if (num_dlabels == 0) { @@ -584,10 +555,6 @@ check_lab_desc(const char *fname, uint16 tag, uint16 ref, const char *label[], c num_errs++; } -#ifdef AN_DEBUG - printf("found data_len=%d, data label=%s\n", strlen(ann_label), ann_label); -#endif - free(ann_label); ann_label = NULL; } /* end for labels */ @@ -628,10 +595,6 @@ check_lab_desc(const char *fname, uint16 tag, uint16 ref, const char *label[], c num_errs++; } -#ifdef AN_DEBUG - printf("found data desclen=%d, desc=%s\n", strlen(ann_desc), ann_desc); -#endif - free(ann_desc); ann_desc = NULL; } /* end for descs */ diff --git a/hdf/util/fp2hdf.c b/hdf/util/fp2hdf.c index 4e188650e0..da16309463 100644 --- a/hdf/util/fp2hdf.c +++ b/hdf/util/fp2hdf.c @@ -526,19 +526,6 @@ gdata(char *infile, struct Input *in, FILE *strm, int *is_maxmin) *is_maxmin = TRUE; } -#ifdef DEBUG - (void)printf("\tdata:"); - for (k = 0, fp32 = in->data; k < in->dims[2]; k++) { - (void)printf("\n"); - for (j = 0; j < in->dims[1]; j++) { - (void)printf("\n\t"); - for (i = 0; i < in->dims[0]; i++, fp32++) - (void)printf("%E ", *fp32); - } - } - (void)printf("\n\n\n"); -#endif /* DEBUG */ - return (0); err: @@ -629,13 +616,6 @@ gdimen(char *infile, struct Input *inp, FILE *strm) goto err; } -#ifdef DEBUG - (void)printf("\nInput Information ...\n\n"); - (void)printf("\trank:\n\n\t%d\n\n", inp->rank); - (void)printf("\tdimensions (nplanes,nrows,ncols):\n\n"); - (void)printf("\t%d %d %d\n\n", inp->dims[2], inp->dims[1], inp->dims[0]); -#endif /* DEBUG */ - return (0); err: @@ -758,11 +738,6 @@ gmaxmin(char *infile, struct Input *in, FILE *strm, int *is_maxmin) *is_maxmin = TRUE; } -#ifdef DEBUG - (void)printf("\tinput maximum/minimum values:\n\n"); - (void)printf("\t%E %E\n\n", in->max, in->min); -#endif /* DEBUG */ - return (0); err: @@ -876,29 +851,6 @@ gscale(char *infile, struct Input *in, FILE *strm, int *is_scale) } } -#ifdef DEBUG - if (in->rank == 2) { - (void)printf("\tscales of the axes (vert,horiz):\n\n\t"); - for (i = 0; i < hdfdims[0]; i++) - (void)printf("%E ", in->vscale[i]); - (void)printf("\n\t"); - for (i = 0; i < hdfdims[1]; i++) - (void)printf("%E ", in->hscale[i]); - } - else { - (void)printf("\tscales of the axes (depth,vert,horiz):\n\n\t"); - for (i = 0; i < hdfdims[0]; i++) - (void)printf("%E ", in->dscale[i]); - (void)printf("\n\t"); - for (i = 0; i < hdfdims[1]; i++) - (void)printf("%E ", in->vscale[i]); - (void)printf("\n\t"); - for (i = 0; i < hdfdims[2]; i++) - (void)printf("%E ", in->hscale[i]); - } - (void)printf("\n\n\n"); -#endif /* DEBUG */ - return (0); err: @@ -1761,9 +1713,6 @@ process(struct Options *opt) int32 len; FILE *strm; int32 hdf; -#ifdef DEBUG - int h, v, d; -#endif /* DEBUG */ const char *err1 = "Error creating HDF output file: %s.\n"; const char *err2 = "Unable to dynamically allocate memory.\n"; @@ -1976,29 +1925,6 @@ process(struct Options *opt) goto err; } } - -#ifdef DEBUG - (void)printf("Output Raster Information ...\n\n"); - (void)printf("\tresolution (horiz,vert,[depth]):\n\n"); - if (in.rank == 2) - (void)printf("\t%d %d\n\n", im.hres, im.vres); - else - (void)printf("\t%d %d %d\n\n", im.hres, im.vres, im.dres); - if (opt->mean == TRUE) { - (void)printf("\tadjusted max/min values:\n\n"); - (void)printf("\t%f %f\n\n", in.max, in.min); - } - (void)printf("\tcolor index values:"); - for (d = 0, ip = im.image; d < im.dres; d++) { - (void)printf("\n"); - for (v = 0; v < im.vres; v++) { - (void)printf("\n"); - for (h = 0; h < im.hres; h++, ip++) - (void)printf("\t%d", *ip); - } - } - (void)printf("\n"); -#endif /* DEBUG */ } /*