Преглед на файлове

cmProc2.h/c : Fixed bug in _cmVectArrayWriteMatrix() which caused the resulting file to be misformatted. Added dcumenation to cmVectArray.

master
Kevin Larke преди 9 години
родител
ревизия
2e815b6046
променени са 2 файла, в които са добавени 16 реда и са изтрити 4 реда
  1. 1
    1
      cmProc2.c
  2. 15
    3
      cmProc2.h

+ 1
- 1
cmProc2.c Целия файл

@@ -4085,7 +4085,7 @@ cmRC_t _cmVectArrayWriteMatrix( cmCtx* ctx, const char* fn, unsigned flags, cons
4085 4085
       memcpy(vv + ci*tbc, v + ci*rn*tbc, tbc );
4086 4086
 
4087 4087
     // append the row to the VectArray
4088
-    if((rc = cmVectArrayAppendV(p,v,cn)) != cmOkRC )
4088
+    if((rc = cmVectArrayAppendV(p,vv,cn)) != cmOkRC )
4089 4089
     {
4090 4090
       rc = cmCtxRtCondition(&p->obj,rc,"Vector append failed in %s().",__FUNCTION__);
4091 4091
       goto errLabel;

+ 15
- 3
cmProc2.h Целия файл

@@ -838,8 +838,12 @@ extern "C" {
838 838
   unsigned cmVectArrayMaxRowCount( const cmVectArray_t* p );
839 839
 
840 840
   // Store a new vector by appending it to the end of the internal vector list.
841
-  // Note that the true type of v[] in the call to cmVectArrayAppendV() must match
841
+  // Note:
842
+  // 1. The true type of v[] in the call to cmVectArrayAppendV() must match
842 843
   // the data type set in p->flags.
844
+  // 2. The 'vn' argument to atVectArrayAppendV() is an element count not
845
+  // a byte count.  The size of each element is determined by the data type
846
+  // as set by atVectArrayAlloc().  
843 847
   cmRC_t cmVectArrayAppendV( cmVectArray_t* p, const void* v,       unsigned vn );
844 848
   cmRC_t cmVectArrayAppendS( cmVectArray_t* p, const cmSample_t* v, unsigned vn );
845 849
   cmRC_t cmVectArrayAppendR( cmVectArray_t* p, const cmReal_t* v,   unsigned vn );
@@ -858,8 +862,12 @@ extern "C" {
858 862
   unsigned cmVectArrayForEachS( cmVectArray_t* p, unsigned idx, unsigned cnt, cmVectArrayForEachFuncS_t func, void* arg ); 
859 863
 
860 864
   // Write the vector v[vn] in the VectArray file format.
861
-  // Note that the true type of v[] in cmVectArrayWriteVectoV() must match the
865
+  // Note:
866
+  // 1. The true type of v[] in cmVectArrayWriteVectoV() must match the
862 867
   // data type set in the 'flags' parameter.
868
+  // 2. The 'vn' argument to atVectArrayWriteVectorV() is an element count not
869
+  // a byte count.  The size of each element is determined by the data type
870
+  // as set by atVectArrayAlloc().   
863 871
   cmRC_t cmVectArrayWriteVectorV( cmCtx* ctx, const char* fn, const void*       v, unsigned  vn, unsigned flags );
864 872
   cmRC_t cmVectArrayWriteVectorS( cmCtx* ctx, const char* fn, const cmSample_t* v, unsigned  vn );
865 873
   cmRC_t cmVectArrayWriteVectorR( cmCtx* ctx, const char* fn, const cmReal_t*   v, unsigned  vn );  
@@ -869,8 +877,12 @@ extern "C" {
869 877
   cmRC_t cmVectArrayWriteVectorU( cmCtx* ctx, const char* fn, const unsigned*   v, unsigned  vn );
870 878
 
871 879
   // Write the column-major matrix m[rn,cn] to the file 'fn'.
872
-  // Note that the true type of m[] in cmVectArrayWriteMatrixV() must match the
880
+  // Notes:
881
+  // 1. The true type of m[] in cmVectArrayWriteMatrixV() must match the
873 882
   // data type set in the 'flags' parameter.
883
+  // 2. The 'rn','cn' arguments to atVectWriteMatrixV() is are element counts not
884
+  // byte counts.  The size of each element is determined by the data type
885
+  // as set by atVectArrayAlloc().
874 886
   cmRC_t cmVectArrayWriteMatrixV( cmCtx* ctx, const char* fn, const void*       m, unsigned  rn, unsigned cn, unsigned flags );
875 887
   cmRC_t cmVectArrayWriteMatrixS( cmCtx* ctx, const char* fn, const cmSample_t* m, unsigned  rn, unsigned cn );
876 888
   cmRC_t cmVectArrayWriteMatrixR( cmCtx* ctx, const char* fn, const cmReal_t*   m, unsigned  rn, unsigned cn );  

Loading…
Отказ
Запис