[Darshan-commits] [Git][darshan/darshan][master] 2 commits: bug fix in common val macros affecting hdf5

Shane Snyder xgitlab at cels.anl.gov
Wed May 27 09:24:56 CDT 2020



Shane Snyder pushed to branch master at darshan / darshan


Commits:
ba2b2e29 by Shane Snyder at 2020-05-27T09:13:34-05:00
bug fix in common val macros affecting hdf5

- - - - -
b8119126 by Shane Snyder at 2020-05-27T09:24:54-05:00
Merge branch 'dev-issue-280-common-val-fix' into 'master'

bug fix in common val macros affecting hdf5

See merge request darshan/darshan!57
- - - - -


1 changed file:

- darshan-runtime/darshan-common.h


Changes:

=====================================
darshan-runtime/darshan-common.h
=====================================
@@ -95,8 +95,8 @@
     if(*(int64_t *)__vals == 0) break; \
     for(i_=0; i_<4; i_++) { \
         if(__add_flag && \
-            !memcmp(__val_p + (i_ * __val_size), \
-                __vals, sizeof(*__vals) * __val_size)) { \
+            !memcmp(__val_p + (i_ * (__val_size)), \
+                __vals, sizeof(*__vals) * (__val_size))) { \
             total_count += *(__cnt_p + i_); \
             break; \
         } \
@@ -107,9 +107,9 @@
     for(i_=0; i_ < 4; i_++) { \
         if((*(__cnt_p + i_) > total_count) || \
            ((*(__cnt_p + i_) == total_count) && \
-           (*(__val_p + (i_ * __val_size)) > *(int64_t *)__vals))) { \
-            memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * __val_size), \
-                sizeof(*__vals) * __val_size); \
+           (*(__val_p + (i_ * (__val_size))) > *(int64_t *)__vals))) { \
+            memcpy(&tmp_val[tmp_ndx * (__val_size)], __val_p + (i_ * (__val_size)), \
+                sizeof(*__vals) * (__val_size)); \
             tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
             tmp_ndx++; \
         } \
@@ -117,21 +117,21 @@
     } \
     if(tmp_ndx == 4) break; /* all done, updated counter is not added */ \
     /* next, add the updated counter */ \
-    memcpy(&tmp_val[tmp_ndx * __val_size], __vals, sizeof(*__vals) * __val_size); \
+    memcpy(&tmp_val[tmp_ndx * (__val_size)], __vals, sizeof(*__vals) * (__val_size)); \
     tmp_cnt[tmp_ndx] = total_count; \
     tmp_ndx++; \
     /* last, copy over any remaining counters to make sure we have 4 sets total */ \
     while(tmp_ndx != 4) { \
-        if(memcmp(__val_p + (i_ * __val_size), \
-                __vals, sizeof(*__vals) * __val_size)) { \
-            memcpy(&tmp_val[tmp_ndx * __val_size], __val_p + (i_ * __val_size), \
-                sizeof(*__vals) * __val_size); \
+        if(memcmp(__val_p + (i_ * (__val_size)), \
+                __vals, sizeof(*__vals) * (__val_size))) { \
+            memcpy(&tmp_val[tmp_ndx * (__val_size)], __val_p + (i_ * (__val_size)), \
+                sizeof(*__vals) * (__val_size)); \
             tmp_cnt[tmp_ndx] = *(__cnt_p + i_); \
             tmp_ndx++; \
         } \
         i_++; \
     } \
-    memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*__val_size); \
+    memcpy(__val_p, tmp_val, 4*sizeof(int64_t)*(__val_size)); \
     memcpy(__cnt_p, tmp_cnt, 4*sizeof(int64_t)); \
 } while(0)
 



View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/2ba50601701c78d81b9c3e24cdeb9814cf114a6e...b8119126ddc1c1e474b392ece3f0652573de77d9

-- 
View it on GitLab: https://xgitlab.cels.anl.gov/darshan/darshan/compare/2ba50601701c78d81b9c3e24cdeb9814cf114a6e...b8119126ddc1c1e474b392ece3f0652573de77d9
You're receiving this email because of your account on xgitlab.cels.anl.gov.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/darshan-commits/attachments/20200527/5507e472/attachment-0001.html>


More information about the Darshan-commits mailing list