summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_main.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2011-02-14 22:20:32 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2011-02-14 22:20:32 (GMT)
commit23a80ac554229f2f0163f1a92a02b921bb6c5e29 (patch)
treecb3558dfe2edb82633f2dd3ad983f753aa519443 /tools/h5repack/h5repack_main.c
parent1c625e6ad97a230fb7baec5a024c47e275a9ee4c (diff)
downloadhdf5-23a80ac554229f2f0163f1a92a02b921bb6c5e29.zip
hdf5-23a80ac554229f2f0163f1a92a02b921bb6c5e29.tar.gz
hdf5-23a80ac554229f2f0163f1a92a02b921bb6c5e29.tar.bz2
[svn-r20103] Purpose:
Change to use HDxxx macros. Description: Originally this started for fixing incorrect pointer usage. But that got fixed through coverity merge. So this is mainly changing to use HDxxx macros and clean up some related code. Tested: jam (linux32-LE), amani (linux64-LE), heiwa (linuxppc64-BE), tejeda (mac32-LE), linew (solaris-BE)
Diffstat (limited to 'tools/h5repack/h5repack_main.c')
-rw-r--r--tools/h5repack/h5repack_main.c34
1 files changed, 15 insertions, 19 deletions
diff --git a/tools/h5repack/h5repack_main.c b/tools/h5repack/h5repack_main.c
index 7d2fc62..99d700d 100644
--- a/tools/h5repack/h5repack_main.c
+++ b/tools/h5repack/h5repack_main.c
@@ -13,10 +13,6 @@
* access to either file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-
#include "h5tools_utils.h"
#include "h5repack.h"
@@ -124,7 +120,7 @@ int main(int argc, const char **argv)
infile = argv[ opt_ind ];
outfile = argv[ opt_ind + 1 ];
- if ( strcmp( infile, outfile ) == 0 )
+ if ( HDstrcmp( infile, outfile ) == 0 )
{
error_msg("file names cannot be the same\n");
usage(h5tools_getprogname());
@@ -390,7 +386,7 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
int idx = 0;
int ssize = 0;
- char *msgPtr = strchr( opt_arg, ':');
+ char *msgPtr = HDstrchr( opt_arg, ':');
options->latest = 1; /* must use latest format */
if (msgPtr == NULL)
{
@@ -401,22 +397,22 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
else
{
char msgType[10];
- strcpy(msgType, msgPtr+1);
+ HDstrcpy(msgType, msgPtr+1);
msgPtr[0] = '\0';
ssize = atoi( opt_arg );
- if (strncmp(msgType, "dspace",6) == 0) {
+ if (HDstrncmp(msgType, "dspace",6) == 0) {
options->msg_size[0] = ssize;
}
- else if (strncmp(msgType, "dtype", 5) == 0) {
+ else if (HDstrncmp(msgType, "dtype", 5) == 0) {
options->msg_size[1] = ssize;
}
- else if (strncmp(msgType, "fill", 4) == 0) {
+ else if (HDstrncmp(msgType, "fill", 4) == 0) {
options->msg_size[2] = ssize;
}
- else if (strncmp(msgType, "pline", 5) == 0) {
+ else if (HDstrncmp(msgType, "pline", 5) == 0) {
options->msg_size[3] = ssize;
}
- else if (strncmp(msgType, "attr", 4) == 0) {
+ else if (HDstrncmp(msgType, "attr", 4) == 0) {
options->msg_size[4] = ssize;
}
}
@@ -454,14 +450,14 @@ void parse_command_line(int argc, const char **argv, pack_opt_t* options)
{
char strategy[MAX_NC_NAME];
- strcpy(strategy, opt_arg);
- if(!strcmp(strategy, "ALL_PERSIST"))
+ HDstrcpy(strategy, opt_arg);
+ if(!HDstrcmp(strategy, "ALL_PERSIST"))
options->fs_strategy = H5F_FILE_SPACE_ALL_PERSIST;
- else if(!strcmp(strategy, "ALL"))
+ else if(!HDstrcmp(strategy, "ALL"))
options->fs_strategy = H5F_FILE_SPACE_ALL;
- else if(!strcmp(strategy, "AGGR_VFD"))
+ else if(!HDstrcmp(strategy, "AGGR_VFD"))
options->fs_strategy = H5F_FILE_SPACE_AGGR_VFD;
- else if(!strcmp(strategy, "VFD"))
+ else if(!HDstrcmp(strategy, "VFD"))
options->fs_strategy = H5F_FILE_SPACE_VFD;
else {
error_msg("invalid file space management strategy\n", opt_arg );
@@ -533,7 +529,7 @@ void read_info(const char *filename,
* filter
*-------------------------------------------------------------------------
*/
- if (strcmp(stype,"-f") == 0) {
+ if (HDstrcmp(stype,"-f") == 0) {
/* find begining of info */
i=0; c='0';
@@ -563,7 +559,7 @@ void read_info(const char *filename,
* layout
*-------------------------------------------------------------------------
*/
- else if (strcmp(stype,"-l") == 0) {
+ else if (HDstrcmp(stype,"-l") == 0) {
/* find begining of info */
i=0; c='0';