Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
teshsuite: smpi: MBI: Merge change form MBI.
[simgrid.git] / teshsuite / smpi / MBI / RMAWinBufferGenerator.py
index 8987f28..8ad4a4f 100755 (executable)
@@ -83,14 +83,14 @@ int main(int argc, char *argv[]) {
 """
 
 
-for b in ['missing', 'null', 'malloc', 'bufferSize']:
+for b in ['missing', 'null',  'malloc', 'bufferSize']:
     patterns = {}
     patterns = {'b': b}
     patterns['origin'] = "MPI-CorrBench"
     patterns['generatedby'] = f'DO NOT EDIT: this file was generated by {os.path.basename(sys.argv[0])}. DO NOT EDIT.'
     patterns['rmafeature'] = 'Yes'
 
-    replace = patterns
+    replace = patterns.copy()
     replace['shortdesc'] = 'Invalid buffer in window creation.'
     replace['longdesc'] = 'Invalid buffer in window creation.'
     replace['outcome'] = 'ERROR: InvalidBuffer'
@@ -107,11 +107,11 @@ for b in ['missing', 'null', 'malloc', 'bufferSize']:
         replace['bufferalloc'] = 'buffer = NULL; /* MBIERROR1 */'
         replace['longdesc'] = 'Use NULL buffer in window creation.'
     elif b == 'bufferSize':
-        replace['bufferalloc'] = 'buffer = malloc((N/2) * sizeof(int)); /* MBIERROR1 */'
+        replace['bufferalloc'] = 'buffer = (int *)malloc((N/2) * sizeof(int)); /* MBIERROR1 */'
         replace['bufferfree'] = 'free(buffer);'
         replace['longdesc'] = 'Unmatched size of buffer in window creation.'
     else:
-        replace['bufferalloc'] = 'buffer = malloc(N * sizeof(int));'
+        replace['bufferalloc'] = 'buffer = (int *)malloc(N * sizeof(int));'
         replace['bufferfree'] = 'free(buffer);'
         replace['longdesc'] = 'Correct initialized buffer in window creation.'
         replace['outcome'] = 'OK'