diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2013-07-31 23:49:47 (GMT) |
commit | e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18 (patch) | |
tree | e3b6e42b691c6ddf7ef9714c132cb922ae28b096 /hl/src | |
parent | 3146ddb5c2fc5e57b72eb2ecce697a7016f92b3a (diff) | |
download | hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.zip hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.gz hdf5-e78fbfd2a2c8e7586d9f18cfeadd2a04b336ef18.tar.bz2 |
[svn-r23959] Bring revisions #23745 - 23862 from trunk to revise_chunks.
h5committested.
Diffstat (limited to 'hl/src')
-rw-r--r-- | hl/src/H5LT.c | 78 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.c | 30 | ||||
-rw-r--r-- | hl/src/H5LTanalyze.l | 4 | ||||
-rw-r--r-- | hl/src/H5LTparse.y | 4 | ||||
-rw-r--r-- | hl/src/Makefile.in | 2 |
5 files changed, 68 insertions, 50 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c index eed2721..b2c8949 100644 --- a/hl/src/H5LT.c +++ b/hl/src/H5LT.c @@ -803,7 +803,7 @@ herr_t H5LTmake_dataset_string(hid_t loc_id, if((tid = H5Tcopy(H5T_C_S1)) < 0 ) goto out; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid, size) < 0) goto out; @@ -1354,7 +1354,7 @@ find_dataset(hid_t loc_id, const char *name, const H5L_info_t *linfo, void *op_d * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = 1; return ret; @@ -1437,7 +1437,7 @@ herr_t H5LTset_attribute_string( hid_t loc_id, if ( (attr_type = H5Tcopy( H5T_C_S1 )) < 0 ) goto out; - attr_size = strlen( attr_data ) + 1; /* extra null term */ + attr_size = HDstrlen( attr_data ) + 1; /* extra null term */ if ( H5Tset_size( attr_type, (size_t)attr_size) < 0 ) goto out; @@ -1936,7 +1936,7 @@ find_attr(hid_t loc_id, const char *name, const H5A_info_t *ainfo, * cause the iterator to immediately return that positive value, * indicating short-circuit success */ - if(strcmp(name, (char *)op_data) == 0) + if(HDstrcmp(name, (char *)op_data) == 0) ret = H5_ITER_STOP; return ret; @@ -2168,17 +2168,19 @@ hid_t H5LTtext_to_dtype(const char *text, H5LT_lang_t lang_type) goto out; if(lang_type != H5LT_DDL) { - fprintf(stderr, "only DDL is supported for now.\n"); + HDfprintf(stderr, "only DDL is supported for now.\n"); goto out; } - input_len = strlen(text); - myinput = strdup(text); + input_len = HDstrlen(text); + myinput = HDstrdup(text); - if((type_id = H5LTyyparse()) < 0) + if((type_id = H5LTyyparse()) < 0) { + HDfree(myinput); goto out; + } - free(myinput); + HDfree(myinput); input_len = 0; return type_id; @@ -2207,12 +2209,12 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad { if(_no_user_buf) { /* If the buffer isn't big enough, reallocate it. Otherwise, go to do strcat. */ - if(str_to_add && ((ssize_t)(*len - (strlen(buf) + strlen(str_to_add) + 1)) < LIMIT)) { - *len += ((strlen(buf) + strlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; - buf = (char*)realloc(buf, *len); - } else if(!str_to_add && ((ssize_t)(*len - strlen(buf) - 1) < LIMIT)) { + if(str_to_add && ((ssize_t)(*len - (HDstrlen(buf) + HDstrlen(str_to_add) + 1)) < LIMIT)) { + *len += ((HDstrlen(buf) + HDstrlen(str_to_add) + 1) / INCREMENT + 1) * INCREMENT; + buf = (char*)HDrealloc(buf, *len); + } else if(!str_to_add && ((ssize_t)(*len - HDstrlen(buf) - 1) < LIMIT)) { *len += INCREMENT; - buf = (char*)realloc(buf, *len); + buf = (char*)HDrealloc(buf, *len); } } @@ -2220,7 +2222,7 @@ realloc_and_append(hbool_t _no_user_buf, size_t *len, char *buf, char *str_to_ad goto out; if(str_to_add) - strcat(buf, str_to_add); + HDstrcat(buf, str_to_add); return buf; @@ -2249,7 +2251,7 @@ indentation(size_t x, char* str, hbool_t no_u_buf, size_t *s_len) char tmp_str[TMP_LEN]; if (x < 80) { - memset(tmp_str, ' ', x); + HDmemset(tmp_str, ' ', x); tmp_str[x]='\0'; } else HDsnprintf(tmp_str, TMP_LEN, "error: the indentation exceeds the number of cols."); @@ -2310,8 +2312,8 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) dst_size = H5Tget_size(native); /* Get the names and raw values of all members */ - name = (char**)calloc((size_t)nmembs, sizeof(char *)); - value = (unsigned char*)calloc((size_t)nmembs, MAX(dst_size, super_size)); + name = (char**)HDcalloc((size_t)nmembs, sizeof(char *)); + value = (unsigned char*)HDcalloc((size_t)nmembs, MAX(dst_size, super_size)); for (i = 0; i < nmembs; i++) { if((name[i] = H5Tget_member_name(type, (unsigned)i))==NULL) @@ -2359,10 +2361,10 @@ print_enum(hid_t type, char* str, size_t *str_len, hbool_t no_ubuf, size_t indt) /* Release resources */ for(i = 0; i < nmembs; i++) - free(name[i]); + HDfree(name[i]); - free(name); - free(value); + HDfree(name); + HDfree(value); H5Tclose(super); return str; @@ -2378,12 +2380,12 @@ out: if(name) { for(i = 0; i < nmembs; i++) if(name[i]) - free(name[i]); - free(name); + HDfree(name[i]); + HDfree(name); } /* end if */ if(value) - free(value); + HDfree(value); if(super >= 0) H5Tclose(super); @@ -2418,13 +2420,13 @@ herr_t H5LTdtype_to_text(hid_t dtype, char *str, H5LT_lang_t lang_type, size_t * goto out; if(len && !str) { - text_str = (char*)calloc(str_len, sizeof(char)); + text_str = (char*)HDcalloc(str_len, sizeof(char)); text_str[0]='\0'; if(!(text_str = H5LT_dtype_to_text(dtype, text_str, lang_type, &str_len, 1))) goto out; - *len = strlen(text_str) + 1; + *len = HDstrlen(text_str) + 1; if(text_str) - free(text_str); + HDfree(text_str); text_str = NULL; } else if(len && str) { if(!(H5LT_dtype_to_text(dtype, str, lang_type, len, 0))) @@ -2744,7 +2746,7 @@ next: if(tag) { HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"%s\";\n", tag); if(tag) - free(tag); + HDfree(tag); tag = NULL; } else HDsnprintf(tmp_str, TMP_LEN, "OPQ_TAG \"\";\n"); @@ -2777,14 +2779,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, ";\n"); @@ -2821,14 +2823,14 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2879,13 +2881,13 @@ next: goto out; if(H5LTdtype_to_text(super, NULL, lang, &super_len) < 0) goto out; - stmp = (char*)calloc(super_len, sizeof(char)); + stmp = (char*)HDcalloc(super_len, sizeof(char)); if(H5LTdtype_to_text(super, stmp, lang, &super_len) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, stmp))) goto out; if(stmp) - free(stmp); + HDfree(stmp); stmp = NULL; HDsnprintf(tmp_str, TMP_LEN, "\n"); if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) @@ -2934,13 +2936,13 @@ next: if(H5LTdtype_to_text(mtype, NULL, lang, &mlen) < 0) goto out; - mtmp = (char*)calloc(mlen, sizeof(char)); + mtmp = (char*)HDcalloc(mlen, sizeof(char)); if(H5LTdtype_to_text(mtype, mtmp, lang, &mlen) < 0) goto out; if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, mtmp))) goto out; if(mtmp) - free(mtmp); + HDfree(mtmp); mtmp = NULL; if (H5T_COMPOUND == mclass) @@ -2950,7 +2952,7 @@ next: if(!(dt_str = realloc_and_append(no_user_buf, slen, dt_str, tmp_str))) goto out; if(mname) - free(mname); + HDfree(mname); mname = NULL; HDsnprintf(tmp_str, TMP_LEN, " : %lu;\n", (unsigned long)moffset); @@ -3560,7 +3562,7 @@ herr_t H5LT_set_attribute_string(hid_t dset_id, if((tid = H5Tcopy(H5T_C_S1)) < 0) return FAIL; - size = strlen(buf) + 1; /* extra null term */ + size = HDstrlen(buf) + 1; /* extra null term */ if(H5Tset_size(tid,(size_t)size) < 0) goto out; diff --git a/hl/src/H5LTanalyze.c b/hl/src/H5LTanalyze.c index 5ec795b..f02bed6 100644 --- a/hl/src/H5LTanalyze.c +++ b/hl/src/H5LTanalyze.c @@ -1400,54 +1400,58 @@ case 57: YY_RULE_SETUP #line 159 "H5LTanalyze.l" { +#ifdef H5_HAVE_WIN32_API + H5LTyylval.sval = _strdup(yytext); +#else /* H5_HAVE_WIN32_API */ H5LTyylval.sval = strdup(yytext); +#endif /* H5_HAVE_WIN32_API */ BEGIN INITIAL; return STRING; } YY_BREAK case 58: YY_RULE_SETUP -#line 165 "H5LTanalyze.l" +#line 169 "H5LTanalyze.l" {return token('{');} YY_BREAK case 59: YY_RULE_SETUP -#line 166 "H5LTanalyze.l" +#line 170 "H5LTanalyze.l" {return token('}');} YY_BREAK case 60: YY_RULE_SETUP -#line 167 "H5LTanalyze.l" +#line 171 "H5LTanalyze.l" {return token('[');} YY_BREAK case 61: YY_RULE_SETUP -#line 168 "H5LTanalyze.l" +#line 172 "H5LTanalyze.l" {return token(']');} YY_BREAK case 62: YY_RULE_SETUP -#line 169 "H5LTanalyze.l" +#line 173 "H5LTanalyze.l" {return token(':');} YY_BREAK case 63: YY_RULE_SETUP -#line 170 "H5LTanalyze.l" +#line 174 "H5LTanalyze.l" {return token(';');} YY_BREAK case 64: YY_RULE_SETUP -#line 171 "H5LTanalyze.l" +#line 175 "H5LTanalyze.l" ; YY_BREAK case 65: YY_RULE_SETUP -#line 172 "H5LTanalyze.l" +#line 176 "H5LTanalyze.l" { return 0; } YY_BREAK case 66: YY_RULE_SETUP -#line 174 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" ECHO; YY_BREAK #line 1432 "H5LTanalyze.c" @@ -2032,7 +2036,11 @@ FILE *file; #if YY_NEVER_INTERACTIVE b->yy_is_interactive = 0; #else - b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#ifdef H5_HAVE_WIN32_API + b->yy_is_interactive = file ? (isatty( _fileno(file) ) > 0) : 0; +#else /* H5_HAVE_WIN32_API */ + b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0; +#endif /* H5_HAVE_WIN32_API */ #endif #endif } @@ -2327,7 +2335,7 @@ int main() return 0; } #endif -#line 174 "H5LTanalyze.l" +#line 178 "H5LTanalyze.l" int my_yyinput(char *buf, int max_size) { diff --git a/hl/src/H5LTanalyze.l b/hl/src/H5LTanalyze.l index 3f63f50..581672b 100644 --- a/hl/src/H5LTanalyze.l +++ b/hl/src/H5LTanalyze.l @@ -157,7 +157,11 @@ OPQ_TAG {return token(OPQ_TAG_TOKEN);} return token('"'); } <TAG_STRING>[^\"]+ { +#ifdef H5_HAVE_WIN32_API + H5LTyylval.sval = _strdup(yytext); +#else /* H5_HAVE_WIN32_API */ H5LTyylval.sval = strdup(yytext); +#endif /* H5_HAVE_WIN32_API */ BEGIN INITIAL; return STRING; } diff --git a/hl/src/H5LTparse.y b/hl/src/H5LTparse.y index a021efc..b91e97e 100644 --- a/hl/src/H5LTparse.y +++ b/hl/src/H5LTparse.y @@ -329,7 +329,11 @@ enum_list : ; enum_def : '"' enum_symbol '"' { is_enum_memb = 1; /*indicate member of enum*/ +#ifdef H5_HAVE_WIN32_API + enum_memb_symbol = _strdup(yylval.sval); +#else /* H5_HAVE_WIN32_API */ enum_memb_symbol = strdup(yylval.sval); +#endif /* H5_HAVE_WIN32_API */ } enum_val ';' { diff --git a/hl/src/Makefile.in b/hl/src/Makefile.in index dc444f9..9d808a2 100644 --- a/hl/src/Makefile.in +++ b/hl/src/Makefile.in @@ -457,7 +457,7 @@ CHECK_CLEANFILES = *.chkexe *.chklog *.clog # Add libtool shared library version numbers to the HDF5 library # See libtool versioning documentation online. LT_VERS_INTERFACE = 6 -LT_VERS_REVISION = 144 +LT_VERS_REVISION = 147 LT_VERS_AGE = 0 # This library is our main target. |