-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix misc gcc warnings #570
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4431,12 +4431,13 @@ test_mgr_chunkwr_pixel(int flag) | |
data_type, /* data type of the image data */ | ||
comp_flag, /* compression flag */ | ||
index, i; | ||
int32 start[2], stride[2], edge[2]; | ||
intn is_mappedable; /* TRUE if the image is mapped-able (hmap project)*/ | ||
intn name_generated; /* TRUE if the image has name generated by lib */ | ||
int16 data_out[3 * Y_LENGTH * X_LENGTH]; | ||
char *image_name[] = {"Image_NO", "Image_RL", "Image_Sk", "Image_DF"}; | ||
char *file_name[] = {"ChunkedGR_NO.hdf", "ChunkedGR_RL.hdf", "ChunkedGR_SK.hdf", "ChunkedGR_DF.hdf"}; | ||
int32 start[2], stride[2], edge[2]; | ||
intn is_mappedable; /* TRUE if the image is mapped-able (hmap project)*/ | ||
intn name_generated; /* TRUE if the image has name generated by lib */ | ||
int16 data_out[3 * Y_LENGTH * X_LENGTH]; | ||
const char *image_name[] = {"Image_NO", "Image_RL", "Image_Sk", "Image_DF"}; | ||
const char *file_name[] = {"ChunkedGR_NO.hdf", "ChunkedGR_RL.hdf", "ChunkedGR_SK.hdf", | ||
"ChunkedGR_DF.hdf"}; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I fixed most of the complaints about assigning const strings to non-const pointers at initialization |
||
HDF_CHUNK_DEF chunk_def; | ||
int16 chunk_buf[18]; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,11 +60,10 @@ test_mgr_compress_a() | |
int32 start[2]; /* start of image data to grab */ | ||
int32 stride[2]; /* stride of image data to grab */ | ||
int32 count[2]; /* Size of image data to operate on */ | ||
intn i, j; /* indices */ | ||
|
||
/* Initialize data we are going to write out */ | ||
for (i = 0; i < 10; i++) | ||
for (j = 0; j < 10; j++) | ||
for (int i = 0; i < 10; i++) | ||
for (int j = 0; j < 10; j++) | ||
image0[i][j] = (uint8)(i + j); | ||
|
||
/* Get the first image in this file */ | ||
|
@@ -103,7 +102,7 @@ test_mgr_compress_a() | |
if (memcmp(image, image0, 10 * 10) != 0) { | ||
MESSAGE(3, printf("Error reading data for gzip compressed image\n");); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
/* Close the empty image */ | ||
ret = GRendaccess(riid); | ||
|
@@ -159,7 +158,7 @@ test_mgr_compress_a() | |
if (memcmp(image, image0, 10 * 10) != 0) { | ||
MESSAGE(3, printf("Error reading 2nd data for gzip compressed image\n");); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
/* Close the empty image */ | ||
ret = GRendaccess(riid); | ||
|
@@ -210,11 +209,10 @@ test_mgr_compress_b() | |
int32 interlace_mode, n_comps, n_attrs, datatype; /* Image information */ | ||
char name[30]; /* Buffer for retrieving image name */ | ||
uint8 attr; /* Attribute data */ | ||
intn i, j; /* indices */ | ||
|
||
/* Initialize data we are going to write out */ | ||
for (i = 0; i < 10; i++) | ||
for (j = 0; j < 10; j++) | ||
for (int i = 0; i < 10; i++) | ||
for (int j = 0; j < 10; j++) | ||
image0[i][j] = (uint8)(i + j); | ||
|
||
/* Get the first image in this file */ | ||
|
@@ -286,7 +284,7 @@ test_mgr_compress_b() | |
if (memcmp(image, image0, 10 * 10) != 0) { | ||
MESSAGE(3, printf("Error reading data for gzip compressed image\n");); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
/* Close the image */ | ||
ret = GRendaccess(riid); | ||
|
@@ -309,16 +307,15 @@ test_mgr_compress_b() | |
static int | ||
test_mgr_compress_c() | ||
{ | ||
intn status; /* status for functions returning an intn */ | ||
int32 file_id, /* HDF file identifier */ | ||
gr_id, /* GR interface identifier */ | ||
ri_id, /* raster image identifier */ | ||
start[2], /* start position to write for each dimension */ | ||
edges[2], /* number of elements to be written along each dimension */ | ||
dim_sizes[2], /* dimension sizes of the image array */ | ||
interlace_mode, /* interlace mode of the image */ | ||
data_type, /* data type of the image data */ | ||
i, j; | ||
int status; /* status for functions returning an int */ | ||
int32 file_id; /* HDF file identifier */ | ||
int32 gr_id; /* GR interface identifier */ | ||
int32 ri_id; /* raster image identifier */ | ||
int32 start[2]; /* start position to write for each dimension */ | ||
int32 edges[2]; /* number of elements to be written along each dimension */ | ||
int32 dim_sizes[2]; /* dimension sizes of the image array */ | ||
int32 interlace_mode; /* interlace mode of the image */ | ||
int32 data_type; /* data type of the image data */ | ||
uint8 image_buf[128][128][3]; | ||
uint8 read_buf[128][128][3]; | ||
comp_info c_info; | ||
|
@@ -351,11 +348,11 @@ test_mgr_compress_c() | |
CHECK(status, FAIL, "GRsetcompress"); | ||
|
||
/* Fill the image data buffer with values */ | ||
for (i = 0; i < 128; i++) | ||
for (j = 0; j < 128; j++) { | ||
image_buf[i][j][0] = (i + j) + 1; | ||
image_buf[i][j][1] = (i + j) + 1; | ||
image_buf[i][j][2] = (i + j) + 1; | ||
for (uint8 i = 0; i < 128; i++) | ||
for (uint8 j = 0; j < 128; j++) { | ||
image_buf[i][j][0] = (uint8)(i + j + 1); | ||
image_buf[i][j][1] = (uint8)(i + j + 1); | ||
image_buf[i][j][2] = (uint8)(i + j + 1); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed complaints about integer casts |
||
} | ||
|
||
/* Write data in the buffer into the image array */ | ||
|
@@ -399,7 +396,7 @@ test_mgr_compress_c() | |
if (fuzzy_memcmp(image_buf, read_buf, 128 * 128 * 3, JPEG_FUZZ) != 0) { | ||
MESSAGE(3, printf("tmgrcomp: Error reading data for 24-bit JPEG compressed image\n");); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
/* Terminate access to raster image and to GR */ | ||
/* interface and, close the HDF file. */ | ||
|
@@ -443,21 +440,20 @@ test_mgr_compress_c() | |
#define DEFLATE_LEVEL 7 /* arbitrary */ | ||
#define SKPHUFF_SKIPSIZE 28 /* arbitrary */ | ||
|
||
static intn | ||
make_comp_image(int32 grid, char *img_name, comp_coder_t comp_type, /* Compression method */ | ||
comp_info *cinfo, char *message) /* Compression parameters */ | ||
static int | ||
make_comp_image(int32 grid, const char *img_name, comp_coder_t comp_type, /* Compression method */ | ||
comp_info *cinfo, char *message) /* Compression parameters */ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Making img_name const quiets a bunch of warnings |
||
{ | ||
int32 riid; /* RI ID of the working image */ | ||
int32 dims[2] = {10, 10}; /* dimensions for the empty image */ | ||
uint8 image_data[10][10]; /* space for the image data */ | ||
int32 start[2]; /* start of image data to grab */ | ||
int32 stride[2]; /* stride of image data to grab */ | ||
intn i, j; /* indices */ | ||
intn ret_value; /* generic return value */ | ||
int ret_value; /* generic return value */ | ||
|
||
/* Initialize data we are going to write out */ | ||
for (i = 0; i < 10; i++) | ||
for (j = 0; j < 10; j++) | ||
for (int i = 0; i < 10; i++) | ||
for (int j = 0; j < 10; j++) | ||
image_data[i][j] = (uint8)(i + j + 10); | ||
|
||
/* Create the image */ | ||
|
@@ -502,7 +498,7 @@ test_get_compress() | |
comp_coder_t comp_type; /* Compression method */ | ||
comp_info cinfo; /* Compression parameters - union */ | ||
char err_func[80]; /* name of the functions where failure occurs */ | ||
intn status; /* generic return value */ | ||
int status; /* generic return value */ | ||
|
||
/* D - Retrieve compression information of compressed images */ | ||
MESSAGE(8, printf("Verify the compression information of compressed images\n");); | ||
|
@@ -689,7 +685,7 @@ test_mgr_chunk_compress() | |
|
||
/************************* Variable declaration **************************/ | ||
|
||
intn status; /* status for functions returning an intn */ | ||
int status; /* status for functions returning an int */ | ||
int32 file_id, /* HDF file identifier */ | ||
gr_id, /* GR interface identifier */ | ||
ri_id[N_IMAGES], /* raster image identifier */ | ||
|
@@ -704,7 +700,7 @@ test_mgr_chunk_compress() | |
|
||
comp_coder_t comp_type; | ||
int16 data_out[3 * Y_LENGTH * X_LENGTH]; | ||
char *image_name[] = {"Image_NO", "Image_RL", "Image_Sk", "Image_DF"}; | ||
const char *image_name[] = {"Image_NO", "Image_RL", "Image_Sk", "Image_DF"}; | ||
HDF_CHUNK_DEF chunk_def[N_IMAGES]; | ||
int16 chunk_buf[18]; | ||
|
||
|
@@ -879,7 +875,7 @@ test_mgr_chunk_compress() | |
MESSAGE(3, printf("Error in reading chunk at line %d\n", __LINE__);); | ||
MESSAGE(3, printf("Image #%d\n", (int)img_num);); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
/* Read the whole image. */ | ||
start[0] = start[1] = 0; | ||
|
@@ -892,7 +888,7 @@ test_mgr_chunk_compress() | |
MESSAGE(3, printf("%d: Error reading data for the whole image\n", __LINE__);); | ||
MESSAGE(3, printf("%d: Compression method\n", (int)img_num);); | ||
num_errs++; | ||
} /* end if */ | ||
} | ||
|
||
status = GRendaccess(ri_id[img_num]); | ||
CHECK(status, FAIL, "GRendaccess"); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -134,7 +134,7 @@ test_szip_RI8bit() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume we want both flags set |
||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for sziped data */ | ||
|
@@ -347,7 +347,7 @@ test_szip_RI16bit() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for sziped data */ | ||
|
@@ -560,7 +560,7 @@ test_szip_RI32bit() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for sziped data */ | ||
|
@@ -773,7 +773,7 @@ test_szip_RIfl32bit() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for sziped data */ | ||
|
@@ -987,7 +987,7 @@ test_szip_RIfl64bit() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for sziped data */ | ||
|
@@ -1144,7 +1144,7 @@ test_szip_chunk() | |
uint32 comp_config; | ||
comp_coder_t comp_type; | ||
int8 data_out[N_COMPS * LENGTH_CH * WIDTH_CH]; | ||
char *image_name = "Image_chunked_sziped"; | ||
const char *image_name = "Image_chunked_sziped"; | ||
HDF_CHUNK_DEF chunk_def; | ||
int8 chunk_buf[18]; | ||
|
||
|
@@ -1169,7 +1169,7 @@ test_szip_chunk() | |
/********************** End of variable declaration **********************/ | ||
|
||
HCget_config_info(COMP_CODE_SZIP, &comp_config); | ||
CHECK_VOID((comp_config & COMP_DECODER_ENABLED | COMP_ENCODER_ENABLED), 0, | ||
CHECK_VOID(((comp_config & COMP_DECODER_ENABLED) && (comp_config & COMP_ENCODER_ENABLED)), 0, | ||
"SZIP Compression not available"); | ||
|
||
/* Create and open the file for chunked and sziped data. */ | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are just noise. We have no plans to rework how the library works in a way that would make these go away.