[Bf-blender-cvs] [ecb4c5d8a43] blenloader-api: change parameter order

Jacques Lucke noreply at git.blender.org
Sat Mar 7 16:24:17 CET 2020


Commit: ecb4c5d8a437f6c19b7875d103188a67d6dfc438
Author: Jacques Lucke
Date:   Sat Mar 7 13:20:33 2020 +0100
Branches: blenloader-api
https://developer.blender.org/rBecb4c5d8a437f6c19b7875d103188a67d6dfc438

change parameter order

===================================================================

M	source/blender/blenkernel/intern/colortools.c
M	source/blender/blenkernel/intern/pointcache.c
M	source/blender/blenloader/BLO_callback_api.h
M	source/blender/blenloader/intern/writefile.c

===================================================================

diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index e7eecd642eb..2725bcb7a2c 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -189,7 +189,7 @@ void BKE_curvemapping_write_file(BloWriter *writer, CurveMapping *cumap)
 void BKE_curvemapping_curves_write_file(BloWriter *writer, CurveMapping *cumap)
 {
   for (int i = 0; i < CM_TOT; i++) {
-    BLO_write_struct_array(writer, CurveMapPoint, cumap->cm[i].curve, cumap->cm[i].totpoint);
+    BLO_write_struct_array(writer, CurveMapPoint, cumap->cm[i].totpoint, cumap->cm[i].curve);
   }
 }
 
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index 457bcf33631..47b26193962 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -3382,11 +3382,11 @@ void BKE_ptcache_file_write(BloWriter *writer, ListBase *ptcaches)
         for (i = 0; i < BPHYS_TOT_DATA; i++) {
           if (pm->data[i] && pm->data_types & (1 << i)) {
             if (ptcache_data_struct[i][0] == '\0') {
-              BLO_write_raw(writer, pm->data[i], MEM_allocN_len(pm->data[i]));
+              BLO_write_raw(writer, MEM_allocN_len(pm->data[i]), pm->data[i]);
             }
             else {
               BLO_write_struct_array_by_name(
-                  writer, ptcache_data_struct[i], pm->data[i], pm->totpoint);
+                  writer, ptcache_data_struct[i], pm->totpoint, pm->data[i]);
             }
           }
         }
@@ -3397,7 +3397,7 @@ void BKE_ptcache_file_write(BloWriter *writer, ListBase *ptcaches)
           }
           BLO_write_struct(writer, PTCacheExtra, extra);
           BLO_write_struct_array_by_name(
-              writer, ptcache_extra_struct[extra->type], extra->data, extra->totdata);
+              writer, ptcache_extra_struct[extra->type], extra->totdata, extra->data);
         }
       }
     }
diff --git a/source/blender/blenloader/BLO_callback_api.h b/source/blender/blenloader/BLO_callback_api.h
index 1d7d1235ec8..47378e2c707 100644
--- a/source/blender/blenloader/BLO_callback_api.h
+++ b/source/blender/blenloader/BLO_callback_api.h
@@ -11,26 +11,26 @@ typedef struct BloReader BloReader;
 /* API for file writing.
  **********************************************/
 
-void BLO_write_raw(BloWriter *writer, const void *data_ptr, int length);
+void BLO_write_raw(BloWriter *writer, int size_in_bytes, const void *data_ptr);
 void BLO_write_struct_by_name(BloWriter *writer, const char *struct_name, const void *data_ptr);
 void BLO_write_struct_array_by_name(BloWriter *writer,
                                     const char *struct_name,
-                                    const void *data_ptr,
-                                    int array_size);
+                                    int array_size,
+                                    const void *data_ptr);
 void BLO_write_struct_by_id(BloWriter *writer, int struct_id, const void *data_ptr);
 void BLO_write_struct_array_by_id(BloWriter *writer,
                                   int struct_id,
-                                  const void *data_ptr,
-                                  int array_size);
+                                  int array_size,
+                                  const void *data_ptr);
 
 int BLO_get_struct_id_by_name(BloWriter *writer, const char *struct_name);
 #define BLO_get_struct_id(writer, struct_name) BLO_get_struct_id_by_name(writer, #struct_name)
 
 #define BLO_write_struct(writer, struct_name, data_ptr) \
   BLO_write_struct_by_id(writer, BLO_get_struct_id(writer, struct_name), data_ptr)
-#define BLO_write_struct_array(writer, struct_name, data_ptr, array_size) \
+#define BLO_write_struct_array(writer, struct_name, array_size, data_ptr) \
   BLO_write_struct_array_by_id( \
-      writer, BLO_get_struct_id(writer, struct_name), data_ptr, array_size)
+      writer, BLO_get_struct_id(writer, struct_name), array_size, data_ptr)
 
 /* API for file reading.
  **********************************************/
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 98f709fdeb3..bbc9c17473f 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -4125,9 +4125,9 @@ bool BLO_write_file_mem(Main *mainvar, MemFile *compare, MemFile *current, int w
   return (err == 0);
 }
 
-void BLO_write_raw(BloWriter *writer, const void *data_ptr, int length)
+void BLO_write_raw(BloWriter *writer, int size_in_bytes, const void *data_ptr)
 {
-  writedata((WriteData *)writer, DATA, length, data_ptr);
+  writedata((WriteData *)writer, DATA, size_in_bytes, data_ptr);
 }
 
 void BLO_write_struct_by_name(BloWriter *writer, const char *struct_name, const void *data_ptr)
@@ -4138,11 +4138,11 @@ void BLO_write_struct_by_name(BloWriter *writer, const char *struct_name, const
 
 void BLO_write_struct_array_by_name(BloWriter *writer,
                                     const char *struct_name,
-                                    const void *data_ptr,
-                                    int array_size)
+                                    int array_size,
+                                    const void *data_ptr)
 {
   int struct_id = BLO_get_struct_id_by_name(writer, struct_name);
-  BLO_write_struct_array_by_id(writer, struct_id, data_ptr, array_size);
+  BLO_write_struct_array_by_id(writer, struct_id, array_size, data_ptr);
 }
 
 void BLO_write_struct_by_id(BloWriter *writer, int struct_id, const void *data_ptr)
@@ -4152,8 +4152,8 @@ void BLO_write_struct_by_id(BloWriter *writer, int struct_id, const void *data_p
 
 void BLO_write_struct_array_by_id(BloWriter *writer,
                                   int struct_id,
-                                  const void *data_ptr,
-                                  int array_size)
+                                  int array_size,
+                                  const void *data_ptr)
 {
   writestruct_nr((WriteData *)writer, DATA, struct_id, array_size, data_ptr);
 }



More information about the Bf-blender-cvs mailing list