Xcos blocks: fix all warnings using -Wall 02/13302/2
Clément DAVID [Tue, 12 Nov 2013 15:37:42 +0000 (16:37 +0100)]
Change-Id: I18c48feee59744bab633c87bd74692d720de2585

105 files changed:
scilab/modules/scicos/includes/scicos.h
scilab/modules/scicos_blocks/src/c/assignment.c
scilab/modules/scicos_blocks/src/c/automat.c
scilab/modules/scicos_blocks/src/c/backlash.c
scilab/modules/scicos_blocks/src/c/bounce_ball.c
scilab/modules/scicos_blocks/src/c/bouncexy.c
scilab/modules/scicos_blocks/src/c/canimxy.c
scilab/modules/scicos_blocks/src/c/canimxy3d.c
scilab/modules/scicos_blocks/src/c/cevscpe.c
scilab/modules/scicos_blocks/src/c/cmat3d.c
scilab/modules/scicos_blocks/src/c/cmatview.c
scilab/modules/scicos_blocks/src/c/cmscope.c
scilab/modules/scicos_blocks/src/c/cscope.c
scilab/modules/scicos_blocks/src/c/cscopxy.c
scilab/modules/scicos_blocks/src/c/cscopxy3d.c
scilab/modules/scicos_blocks/src/c/csslti4.c
scilab/modules/scicos_blocks/src/c/cstblk4_m.c
scilab/modules/scicos_blocks/src/c/curve_c.c
scilab/modules/scicos_blocks/src/c/deriv.c
scilab/modules/scicos_blocks/src/c/dmmul.c
scilab/modules/scicos_blocks/src/c/dmmul1.c
scilab/modules/scicos_blocks/src/c/dollar4_m.c
scilab/modules/scicos_blocks/src/c/dsslti4.c
scilab/modules/scicos_blocks/src/c/evtdly4.c
scilab/modules/scicos_blocks/src/c/extract.c
scilab/modules/scicos_blocks/src/c/extract_bit_16_LSB.c
scilab/modules/scicos_blocks/src/c/extract_bit_16_RB0.c
scilab/modules/scicos_blocks/src/c/extract_bit_16_RB1.c
scilab/modules/scicos_blocks/src/c/extract_bit_32_LSB.c
scilab/modules/scicos_blocks/src/c/extract_bit_32_RB0.c
scilab/modules/scicos_blocks/src/c/extract_bit_32_RB1.c
scilab/modules/scicos_blocks/src/c/extract_bit_8_LSB.c
scilab/modules/scicos_blocks/src/c/extract_bit_8_RB0.c
scilab/modules/scicos_blocks/src/c/extract_bit_8_RB1.c
scilab/modules/scicos_blocks/src/c/extract_bit_u16_RB1.c
scilab/modules/scicos_blocks/src/c/extract_bit_u32_RB1.c
scilab/modules/scicos_blocks/src/c/extract_bit_u8_RB1.c
scilab/modules/scicos_blocks/src/c/extractz.c
scilab/modules/scicos_blocks/src/c/fromws_c.c
scilab/modules/scicos_blocks/src/c/lookup_c.c
scilab/modules/scicos_blocks/src/c/m_frequ.c
scilab/modules/scicos_blocks/src/c/mat_bksl.c
scilab/modules/scicos_blocks/src/c/mat_det.c
scilab/modules/scicos_blocks/src/c/mat_div.c
scilab/modules/scicos_blocks/src/c/mat_expm.c
scilab/modules/scicos_blocks/src/c/mat_inv.c
scilab/modules/scicos_blocks/src/c/mat_lu.c
scilab/modules/scicos_blocks/src/c/mat_pinv.c
scilab/modules/scicos_blocks/src/c/mat_sing.c
scilab/modules/scicos_blocks/src/c/mat_svd.c
scilab/modules/scicos_blocks/src/c/mat_vps.c
scilab/modules/scicos_blocks/src/c/mat_vpv.c
scilab/modules/scicos_blocks/src/c/mathermit_m.c
scilab/modules/scicos_blocks/src/c/matmul_i32s.c
scilab/modules/scicos_blocks/src/c/matmul_i8e.c
scilab/modules/scicos_blocks/src/c/matmul_i8n.c
scilab/modules/scicos_blocks/src/c/matmul_i8s.c
scilab/modules/scicos_blocks/src/c/matmul_ui16e.c
scilab/modules/scicos_blocks/src/c/matmul_ui16n.c
scilab/modules/scicos_blocks/src/c/matmul_ui16s.c
scilab/modules/scicos_blocks/src/c/matmul_ui32e.c
scilab/modules/scicos_blocks/src/c/matmul_ui32n.c
scilab/modules/scicos_blocks/src/c/mattran_m.c
scilab/modules/scicos_blocks/src/c/matz_bksl.c
scilab/modules/scicos_blocks/src/c/matz_det.c
scilab/modules/scicos_blocks/src/c/matz_div.c
scilab/modules/scicos_blocks/src/c/matz_expm.c
scilab/modules/scicos_blocks/src/c/matz_inv.c
scilab/modules/scicos_blocks/src/c/matz_lu.c
scilab/modules/scicos_blocks/src/c/matz_pinv.c
scilab/modules/scicos_blocks/src/c/matz_sing.c
scilab/modules/scicos_blocks/src/c/matz_sqrt.c
scilab/modules/scicos_blocks/src/c/matz_svd.c
scilab/modules/scicos_blocks/src/c/matz_vps.c
scilab/modules/scicos_blocks/src/c/matz_vpv.c
scilab/modules/scicos_blocks/src/c/matzmul_m.c
scilab/modules/scicos_blocks/src/c/matztran_m.c
scilab/modules/scicos_blocks/src/c/ratelimiter.c
scilab/modules/scicos_blocks/src/c/ricc_m.c
scilab/modules/scicos_blocks/src/c/rndblk_m.c
scilab/modules/scicos_blocks/src/c/rndblkz_m.c
scilab/modules/scicos_blocks/src/c/root_coef.c
scilab/modules/scicos_blocks/src/c/rootz_coef.c
scilab/modules/scicos_blocks/src/c/samphold4_m.c
scilab/modules/scicos_blocks/src/c/summation_i16s.c
scilab/modules/scicos_blocks/src/c/summation_i32e.c
scilab/modules/scicos_blocks/src/c/summation_i32n.c
scilab/modules/scicos_blocks/src/c/summation_i32s.c
scilab/modules/scicos_blocks/src/c/summation_i8e.c
scilab/modules/scicos_blocks/src/c/summation_i8n.c
scilab/modules/scicos_blocks/src/c/summation_i8s.c
scilab/modules/scicos_blocks/src/c/summation_ui16e.c
scilab/modules/scicos_blocks/src/c/summation_ui16n.c
scilab/modules/scicos_blocks/src/c/summation_ui16s.c
scilab/modules/scicos_blocks/src/c/summation_ui32e.c
scilab/modules/scicos_blocks/src/c/summation_ui32n.c
scilab/modules/scicos_blocks/src/c/summation_ui32s.c
scilab/modules/scicos_blocks/src/c/summation_ui8e.c
scilab/modules/scicos_blocks/src/c/summation_ui8n.c
scilab/modules/scicos_blocks/src/c/summation_ui8s.c
scilab/modules/scicos_blocks/src/c/tcslti4.c
scilab/modules/scicos_blocks/src/c/tcsltj4.c
scilab/modules/scicos_blocks/src/c/time_delay.c
scilab/modules/scicos_blocks/src/c/tows_c.c
scilab/modules/scicos_blocks/src/c/variable_delay.c

index 544fa2c..ab1bf21 100644 (file)
@@ -178,6 +178,16 @@ int C2F(scicos) (double *x_in, int *xptr_in, double *z__,
                  int *critev_in, int *nblk1, int *ztyp, int *zcptr_in, int *subscr, int *nsubs, double *simpar, int *flag__, int *ierr_out);
 
 /**
+ * \brief Discrete time counter type
+ *
+ * Used on [evtdly4.c](@ref evtdly4), [m_frequ.c](@ref m_frequ) or
+ * [time_delay.c](@ref time_delay) to manage time difference.
+ *
+ * Warning: effect maximum simulation time (in term of max simulation step).
+ */
+typedef long long int time_counter_t;
+
+/**
 *
 */
 void callf(double *t, scicos_block * block, scicos_flag * flag);
index 8381214..f1e4403 100644 (file)
@@ -55,13 +55,12 @@ SCICOS_BLOCKS_IMPEXP void assignment(scicos_block *block, int flag)
 
     else if (flag == 1)
     {
-        double *otsz, *indxopt, *indxb, *indx1, *indx2;
+        double *indxopt, *indxb, *indx1, *indx2;
         int typ, i, j, nev;
         int *tempind1 = NULL, *tempind2 = NULL;
         void *y = NULL, *u = NULL;
         tempind1 = (int *) * (block->work);
         tempind2 = tempind1 + (my + 1);
-        otsz = GetRealOparPtrs(block, 5);
         indx2 = GetRealOparPtrs(block, 4);
         indx1 = GetRealOparPtrs(block, 3);
         indxopt = GetRealOparPtrs(block, 2);
index 3fdd295..1b3f8c4 100644 (file)
@@ -37,7 +37,7 @@ SCICOS_BLOCKS_IMPEXP void automat(scicos_block *block, int flag)
     double* x = block->x;
     double* xd = block->xd;
     double* res = block->res;
-    void**   work = block->work;
+    int**   work = (int**) block->work;
     double* rpar = block->rpar;
     double* evout = block->evout;
 
@@ -64,7 +64,7 @@ SCICOS_BLOCKS_IMPEXP void automat(scicos_block *block, int flag)
 
     if (flag == 4) /*----------------------------------------------------------*/
     {
-        if ((*work = scicos_malloc(sizeof(int) * (2))) == NULL )
+        if ((*work = (int*) scicos_malloc(sizeof(int) * (2))) == NULL )
         {
             set_block_error(-16);
             return;
index a014e60..7a9b660 100644 (file)
 SCICOS_BLOCKS_IMPEXP void backlash(scicos_block *block, int flag)
 {
     double* rw = NULL, t  = 0.;
+    double** work = (double**) block->work;
+
     if (flag == 4) /* the workspace is used to store previous values */
     {
-        if ((*block->work =     scicos_malloc(sizeof(double) * 4)) == NULL )
+        if ((*work = (double*) scicos_malloc(sizeof(double) * 4)) == NULL )
         {
             set_block_error(-16);
             return;
         }
-        rw = *block->work;
+        rw = *work;
         t = get_scicos_time();
         rw[0] = t;
         rw[1] = t;
@@ -45,11 +47,11 @@ SCICOS_BLOCKS_IMPEXP void backlash(scicos_block *block, int flag)
     }
     else  if (flag == 5)
     {
-        scicos_free(*block->work);
+        scicos_free(*work);
     }
     else  if (flag == 1)
     {
-        rw = *block->work;
+        rw = *work;
         t = get_scicos_time();
         if (t > rw[1])
         {
@@ -73,7 +75,7 @@ SCICOS_BLOCKS_IMPEXP void backlash(scicos_block *block, int flag)
     }
     else if (flag == 9)
     {
-        rw = *block->work;
+        rw = *work;
         t = get_scicos_time();
         if (t > rw[1])
         {
index cab92da..f2b4d0e 100644 (file)
@@ -26,7 +26,7 @@
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void bounce_ball(scicos_block *block, int flag)
 {
-    int nevprt = 0, nx = 0, *ipar = NULL;
+    int nevprt = 0, *ipar = NULL;
     int *outsz = NULL;
     double *x = NULL, *xd = NULL, *rpar = NULL;
     double *g = NULL;
@@ -51,7 +51,6 @@ SCICOS_BLOCKS_IMPEXP void bounce_ball(scicos_block *block, int flag)
     /*     y2: y-coord des balles */
     /*     ipar: storage de taille [nx(n-1)/2=ng]*2 */
     nevprt = block->nevprt;
-    nx = block->nx;
     ipar = block->ipar;
     outsz = block->outsz;
     x = block->x;
index c4807b4..1c5b029 100644 (file)
@@ -162,7 +162,7 @@ SCICOS_BLOCKS_IMPEXP void bouncexy(scicos_block * block, scicos_flag flag)
                 set_block_error(-5);
             }
             iFigureUID = getFigure(block);
-            if (iFigureUID == 0)
+            if (iFigureUID == NULL)
             {
                 // allocation error
                 set_block_error(-5);
@@ -171,7 +171,7 @@ SCICOS_BLOCKS_IMPEXP void bouncexy(scicos_block * block, scicos_flag flag)
 
         case StateUpdate:
             iFigureUID = getFigure(block);
-            if (iFigureUID == 0)
+            if (iFigureUID == NULL)
             {
                 // allocation error
                 set_block_error(-5);
@@ -391,7 +391,7 @@ static int getFigure(scicos_block * block)
 
     iFigureUID = getFigureFromIndex(figNum);
     // create on demand
-    if (iFigureUID == 0)
+    if (iFigureUID == NULL)
     {
         iFigureUID = createNewFigureWithAxes();
         setGraphicObjectProperty(iFigureUID, __GO_ID__, &figNum, jni_int, 1);
@@ -429,7 +429,7 @@ static int getAxe(int iFigureUID, scicos_block * block)
     // assert the sco is not NULL
     if (sco == NULL)
     {
-        return 0;
+        return NULL;
     }
 
     // fast path for an existing object
@@ -443,7 +443,7 @@ static int getAxe(int iFigureUID, scicos_block * block)
     /*
      * Allocate if necessary
      */
-    if (iAxe == 0)
+    if (iAxe == NULL)
     {
         cloneAxesModel(iFigureUID);
         iAxe = findChildWithKindAt(iFigureUID, __GO_AXES__, 0);
@@ -452,7 +452,7 @@ static int getAxe(int iFigureUID, scicos_block * block)
     /*
      * Setup on first access
      */
-    if (iAxe != 0)
+    if (iAxe != NULL)
     {
         // allocate the polylines through the getter
         for (i = 0; i < block->insz[0]; i++)
@@ -462,7 +462,7 @@ static int getAxe(int iFigureUID, scicos_block * block)
     }
     else
     {
-        return 0;
+        return NULL;
     }
 
     /*
@@ -486,7 +486,7 @@ static int getArc(int iAxeUID, scicos_block * block, int row)
     // assert the sco is not NULL
     if (sco == NULL || sco->scope.cachedArcsUIDs == NULL)
     {
-        return 0;
+        return NULL;
     }
 
     // fast path for an existing object
@@ -504,14 +504,14 @@ static int getArc(int iAxeUID, scicos_block * block, int row)
     {
         iArc = createGraphicObject(__GO_ARC__);
 
-        if (iArc != 0)
+        if (iArc != NULL)
         {
             createDataObject(iArc, __GO_ARC__);
             setGraphicObjectRelationship(iAxeUID, iArc);
         }
         else
         {
-            return 0;
+            return NULL;
         }
     }
 
index e2ddff5..a8817bb 100644 (file)
@@ -174,7 +174,7 @@ SCICOS_BLOCKS_IMPEXP void canimxy(scicos_block * block, scicos_flag flag)
                 break;
             }
 
-            appendData(block, block->inptr[0], block->inptr[1]);
+            appendData(block, GetRealInPortPtrs(block, 1), GetRealInPortPtrs(block, 2));
             for (j = 0; j < block->insz[0]; j++)
             {
                 result = pushData(block, j);
@@ -348,8 +348,6 @@ static BOOL pushData(scicos_block * block, int row)
     double *coordinates;
     sco_data *sco;
 
-    BOOL result = TRUE;
-
     iFigureUID = getFigure(block);
     iAxeUID = getAxe(iFigureUID, block);
     iPolylineUID = getPolyline(iAxeUID, block, row);
@@ -526,7 +524,6 @@ static int getAxe(int iFigureUID, scicos_block * block)
 static int getPolyline(int iAxeUID, scicos_block * block, int row)
 {
     int iPolyline = 0;
-    double d__0 = 0.0;
     BOOL b__true = TRUE;
 
     int color;
index 9c2e6c8..a9fd4cd 100644 (file)
@@ -178,7 +178,7 @@ SCICOS_BLOCKS_IMPEXP void canimxy3d(scicos_block * block, scicos_flag flag)
                 break;
             }
 
-            appendData(block, block->inptr[0], block->inptr[1], block->inptr[2]);
+            appendData(block, GetRealInPortPtrs(block, 1), GetRealInPortPtrs(block, 2), GetRealInPortPtrs(block, 3));
             for (j = 0; j < block->insz[0]; j++)
             {
                 result = pushData(block, j);
@@ -539,7 +539,6 @@ static int getAxe(int iFigureUID, scicos_block * block)
 static int getPolyline(int iAxeUID, scicos_block * block, int row)
 {
     int iPolyline = 0;
-    static double d__0 = 0.0;
     static BOOL b__true = TRUE;
 
     int color;
@@ -646,7 +645,11 @@ static BOOL setPolylinesBounds(scicos_block * block)
     iAxeUID = getAxe(iFigureUID, block);
 
     result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
-    result &= setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
 
     return result;
 }
index a9d23bb..a300e5c 100644 (file)
@@ -497,7 +497,7 @@ static BOOL pushData(scicos_block * block, int input)
     double *direction;
     sco_data *sco;
 
-    BOOL result = TRUE;
+    BOOL result;
 
     iFigureUID = getFigure(block);
     iAxeUID = getAxe(iFigureUID, block);
@@ -515,8 +515,12 @@ static BOOL pushData(scicos_block * block, int input)
 
     dataLen = 3 * sco->internal.maxNumberOfPoints[input];
 
-    result &= setGraphicObjectProperty(iSegsUID, __GO_BASE__, base, jni_double_vector, dataLen);
-    result &= setGraphicObjectProperty(iSegsUID, __GO_DIRECTION__, direction, jni_double_vector, dataLen);
+    result = setGraphicObjectProperty(iSegsUID, __GO_BASE__, base, jni_double_vector, dataLen);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iSegsUID, __GO_DIRECTION__, direction, jni_double_vector, dataLen);
 
     return result;
 }
@@ -777,7 +781,7 @@ static BOOL setSegsBuffers(scicos_block * block, int maxNumberOfPoints)
     for (i = 0; i < nclk; i++)
     {
         iSegsUID = getSegs(iAxeUID, block, i);
-        result &= setGraphicObjectProperty(iSegsUID, __GO_NUMBER_ARROWS__, &maxNumberOfPoints, jni_int, 1);
+        result = setGraphicObjectProperty(iSegsUID, __GO_NUMBER_ARROWS__, &maxNumberOfPoints, jni_int, 1);
 
         /*
          * Update color due to bug #9902
index 8c3a102..59a0897 100644 (file)
@@ -493,8 +493,16 @@ static BOOL setBounds(scicos_block * block, int iAxeUID, int iPlot3dUID)
     rotationAngle[1] = 280;     // theta
 
     result = setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_GRID_SIZE__, gridSize, jni_int_vector, 4);
-    result &= setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
-    result &= setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
 
     return result;
 }
@@ -506,16 +514,36 @@ static BOOL setPlot3dSettings(int iPlot3dUID)
     int i__2 = 2;
     int i__4 = 4;
 
-    BOOL result = TRUE;
+    BOOL result;
 
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_SURFACE_MODE__, &i__1, jni_bool, 1);
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_LINE_THICKNESS__, &d__1, jni_double, 1);
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_SURFACE_MODE__, &i__1, jni_bool, 1);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_LINE_THICKNESS__, &d__1, jni_double, 1);
+    if (result == FALSE)
+    {
+        return result;
+    }
 
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_COLOR_MODE__, &i__2, jni_int, 1);
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_COLOR_FLAG__, &i__1, jni_int, 1);
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_HIDDEN_COLOR__, &i__4, jni_int, 1);
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_COLOR_MODE__, &i__2, jni_int, 1);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_COLOR_FLAG__, &i__1, jni_int, 1);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_HIDDEN_COLOR__, &i__4, jni_int, 1);
+    if (result == FALSE)
+    {
+        return result;
+    }
 
-    setGraphicObjectProperty(iPlot3dUID, __GO_CLIP_STATE__, &i__1, jni_int, 1);
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_CLIP_STATE__, &i__1, jni_int, 1);
 
     return result;
 }
@@ -540,6 +568,10 @@ static BOOL setDefaultValues(scicos_block * block, int iPlot3dUID)
         return FALSE;
     }
     result = setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_Z__, values, jni_double_vector, m * n);
+    if (result == FALSE)
+    {
+        goto local_return;
+    }
 
     len = Max(m, n);
     for (i = 1; i <= len; i++)
@@ -547,9 +579,15 @@ static BOOL setDefaultValues(scicos_block * block, int iPlot3dUID)
         values[i] = (double) i;
     }
 
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
-    result &= setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
+    if (result == FALSE)
+    {
+        goto local_return;
+    }
+    result = setGraphicObjectProperty(iPlot3dUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
 
+local_return:
     FREE(values);
     return result;
 }
+
index 21f1866..982caec 100644 (file)
@@ -496,7 +496,15 @@ static BOOL setBounds(scicos_block * block, int iAxeUID, int iGrayplotUID)
     dataBounds[5] = 1.0;        // zMax
 
     result = setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_GRID_SIZE__, gridSize, jni_int_vector, 4);
-    result &= setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
+    if (result == FALSE)
+    {
+        return result;
+    }
 
     return result;
 }
@@ -521,14 +529,28 @@ static BOOL setDefaultValues(scicos_block * block, int iGrayplotUID)
     }
 
     result = setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_Z__, values, jni_double_vector, m * n);
+    if (result == FALSE)
+    {
+        goto local_return;
+    }
 
     for (i = 1; i <= len; i++)
     {
         values[i] = (double)i;
     }
-    result &= setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
-    result &= setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
 
+    result = setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_X__, values, jni_double_vector, m);
+    if (result == FALSE)
+    {
+        goto local_return;
+    }
+    result = setGraphicObjectProperty(iGrayplotUID, __GO_DATA_MODEL_Y__, values, jni_double_vector, n);
+    if (result == FALSE)
+    {
+        goto local_return;
+    }
+
+local_return:
     FREE(values);
     return result;
 }
index 6150444..1fe5bd7 100644 (file)
@@ -291,7 +291,7 @@ SCICOS_BLOCKS_IMPEXP void cmscope(scicos_block * block, scicos_flag flag)
 static sco_data *getScoData(scicos_block * block)
 {
     sco_data *sco = (sco_data *) * (block->work);
-    int i, j, k, l;
+    int i, j;
 
     if (sco == NULL)
     {
@@ -416,14 +416,16 @@ error_handler_historyCoordinates_i:
     }
     FREE(sco->internal.historyCoordinates);
 error_handler_historyCoordinates:
-    i = block->nin - 1;
-    j = block->insz[i] - 1;
 error_handler_bufferCoordinates_ij:
-    for (k = 0; k < i; k++)
+    for (i = 0; i < block->nin - 1; i++)
     {
-        for (l = 0; l < j; l++)
+        for (j = 0; j < block->insz[i] - 1; j++)
         {
-            FREE(sco->internal.bufferCoordinates[k][l]);
+            double* ptr = sco->internal.bufferCoordinates[i][j];
+            if (ptr != NULL)
+            {
+                FREE(ptr);
+            }
         }
     }
     i = block->nin - 1;
@@ -1073,7 +1075,11 @@ static BOOL pushHistory(scicos_block * block, int input, int maxNumberOfPoints)
         data = sco->internal.historyCoordinates[input][i];
 
         PUSH_LOG("%s: %d\n", "pushHistory", maxNumberOfPoints);
-        result &= setGraphicObjectProperty(iPolylineUID, __GO_DATA_MODEL_COORDINATES__, data, jni_double_vector, maxNumberOfPoints);
+        result = setGraphicObjectProperty(iPolylineUID, __GO_DATA_MODEL_COORDINATES__, data, jni_double_vector, maxNumberOfPoints);
+        if (result == FALSE)
+        {
+            return result;
+        }
     }
 
     return result;
index 7d6a74d..00d8978 100644 (file)
@@ -275,7 +275,7 @@ SCICOS_BLOCKS_IMPEXP void cscope(scicos_block * block, scicos_flag flag)
 static sco_data *getScoData(scicos_block * block)
 {
     sco_data *sco = (sco_data *) * (block->work);
-    int i, j, k, l;
+    int i, j;
 
     if (sco == NULL)
     {
@@ -365,14 +365,16 @@ error_handler_historyCoordinates_i:
     }
     FREE(sco->internal.historyCoordinates);
 error_handler_historyCoordinates:
-    i = block->nin - 1;
-    j = block->insz[i] - 1;
 error_handler_bufferCoordinates_ij:
-    for (k = 0; k < i; k++)
+    for (i = 0; i < block->nin - 1; i++)
     {
-        for (l = 0; l < j; l++)
+        for (j = 0; j < block->insz[i] - 1; j++)
         {
-            FREE(sco->internal.bufferCoordinates[k][l]);
+            double* ptr = sco->internal.bufferCoordinates[i][j];
+            if (ptr != NULL)
+            {
+                FREE(ptr);
+            }
         }
     }
     i = block->nin - 1;
@@ -970,7 +972,11 @@ static BOOL pushHistory(scicos_block * block, int input, int maxNumberOfPoints)
         iPolylineUID = getPolyline(iAxeUID, block, i, TRUE);
 
         data = sco->internal.historyCoordinates[input][i];
-        result &= setGraphicObjectProperty(iPolylineUID, __GO_DATA_MODEL_COORDINATES__, data, jni_double_vector, maxNumberOfPoints);
+        result = setGraphicObjectProperty(iPolylineUID, __GO_DATA_MODEL_COORDINATES__, data, jni_double_vector, maxNumberOfPoints);
+        if (result == FALSE)
+        {
+            return result;
+        }
     }
 
     return result;
index 6053b2c..f148f2e 100644 (file)
@@ -173,7 +173,7 @@ SCICOS_BLOCKS_IMPEXP void cscopxy(scicos_block * block, scicos_flag flag)
                 break;
             }
 
-            appendData(block, block->inptr[0], block->inptr[1]);
+            appendData(block, GetRealInPortPtrs(block, 1), GetRealInPortPtrs(block, 2));
             for (j = 0; j < block->insz[0]; j++)
             {
                 result = pushData(block, j);
@@ -558,7 +558,6 @@ static int getAxe(int iFigureUID, scicos_block * block)
 static int getPolyline(int iAxeUID, scicos_block * block, int row)
 {
     int iPolyline;
-    double d__0 = 0.0;
     BOOL b__true = TRUE;
 
     int color;
index 7c13261..0f81d6c 100644 (file)
@@ -160,7 +160,7 @@ SCICOS_BLOCKS_IMPEXP void cscopxy3d(scicos_block * block, scicos_flag flag)
                 set_block_error(-5);
             }
             iFigureUID = getFigure(block);
-            if (iFigureUID == 0)
+            if (iFigureUID == NULL)
             {
                 // allocation error
                 set_block_error(-5);
@@ -169,14 +169,14 @@ SCICOS_BLOCKS_IMPEXP void cscopxy3d(scicos_block * block, scicos_flag flag)
 
         case StateUpdate:
             iFigureUID = getFigure(block);
-            if (iFigureUID == 0)
+            if (iFigureUID == NULL)
             {
                 // allocation error
                 set_block_error(-5);
                 break;
             }
 
-            appendData(block, block->inptr[0], block->inptr[1], block->inptr[2]);
+            appendData(block, GetRealInPortPtrs(block, 1), GetRealInPortPtrs(block, 2), GetRealInPortPtrs(block, 3));
             for (j = 0; j < block->insz[0]; j++)
             {
                 result = pushData(block, j);
@@ -465,7 +465,7 @@ static int getFigure(scicos_block * block)
     // assert the sco is not NULL
     if (sco == NULL)
     {
-        return 0;
+        return NULL;
     }
 
     // fast path for an existing object
@@ -681,7 +681,11 @@ static BOOL setPolylinesBounds(scicos_block * block)
     iAxeUID = getAxe(iFigureUID, block);
 
     result = setGraphicObjectProperty(iAxeUID, __GO_DATA_BOUNDS__, dataBounds, jni_double_vector, 6);
-    result &= setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
+    if (result == FALSE)
+    {
+        return result;
+    }
+    result = setGraphicObjectProperty(iAxeUID, __GO_ROTATION_ANGLES__, rotationAngle, jni_double_vector, 2);
 
     return result;
 }
index e001309..41d8478 100644 (file)
 #include "machine.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dmmul)();
-extern int C2F(dmmul1)();
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
+extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__,
+                       int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void csslti4(scicos_block *block, int flag)
 {
index ebafec6..1c732d8 100644 (file)
@@ -30,10 +30,9 @@ SCICOS_BLOCKS_IMPEXP void cstblk4_m(scicos_block *block, int flag)
     Scicos block simulator
     output a vector of constants out(i)=opar(i)
     opar(1:nopar) : given constants */
-    int nopar = 0, mo = 0, no = 0, so = 0;
+    int mo = 0, no = 0, so = 0;
     void *y = NULL;
     void *opar = NULL;
-    nopar = GetNopar(block);
     y = GetOutPortPtrs(block, 1);
     opar = GetOparPtrs(block, 1);
     mo = GetOparSize(block, 1, 1);
index d2774a5..f035f55 100644 (file)
@@ -42,6 +42,7 @@
 SCICOS_BLOCKS_IMPEXP void curve_c(scicos_block *block, int flag)
 {
     double t = 0., a = 0., b = 0., c = 0., y1 = 0., y2 = 0., t1 = 0., t2 = 0.;
+    int** work = (int**) block->work;
     int *ind = NULL, i = 0, inow = 0;
     double *y = NULL;
     double  d1 = 0., d2 = 0., h = 0., dh = 0., ddh = 0., dddh = 0.;
@@ -51,12 +52,12 @@ SCICOS_BLOCKS_IMPEXP void curve_c(scicos_block *block, int flag)
             /* init */
         case 4  :  /* the workspace is used to store discrete counter value */
         {
-            if ((*block->work = scicos_malloc(4 * sizeof(int))) == NULL)
+            if ((*work = (int*) scicos_malloc(4 * sizeof(int))) == NULL)
             {
                 set_block_error(-16);
                 return;
             }
-            ind = *block->work;
+            ind = *work;
             ind[0] = nPoints - 1;
             ind[1] = nPoints;
             for (i = 0; i < nPoints; i++)
@@ -80,7 +81,7 @@ SCICOS_BLOCKS_IMPEXP void curve_c(scicos_block *block, int flag)
         case 1  :
         {
             y = GetRealOutPortPtrs(block, 1);
-            ind = *block->work;
+            ind = *work;
             t = get_scicos_time();
             if (Periodic == 1)
             {
@@ -167,7 +168,7 @@ SCICOS_BLOCKS_IMPEXP void curve_c(scicos_block *block, int flag)
         /* event date computation */
         case 3  :
         {
-            ind = *block->work;
+            ind = *work;
 
             /*---------*/
             if ((Order == 1) || (Order == 0))
@@ -218,7 +219,7 @@ SCICOS_BLOCKS_IMPEXP void curve_c(scicos_block *block, int flag)
         /* finish */
         case 5  :
         {
-            scicos_free(*block->work); /*free the workspace*/
+            scicos_free(*work); /*free the workspace*/
             break;
         }
 
index 0d106e7..87f1801 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void deriv(scicos_block *block, int flag)
 {
+    double** work = (double**) block->work;
     double* rw = NULL;
     double t = 0., dt = 0.;
     int i = 0;
     if (flag == 4) /* the workspace is used to store previous values */
     {
-        if ((*block->work =
-                    scicos_malloc(sizeof(double) * 2 * (1 + block->insz[0]))) == NULL )
+        if ((*work = (double*) scicos_malloc(sizeof(double) * 2 * (1 + block->insz[0]))) == NULL )
         {
             set_block_error(-16);
             return;
         }
-        rw = *block->work;
+        rw = *work;
         t = get_scicos_time();
         rw[0] = t;
         rw[1] = t;
@@ -51,11 +51,11 @@ SCICOS_BLOCKS_IMPEXP void deriv(scicos_block *block, int flag)
     }
     else  if (flag == 5)
     {
-        scicos_free(*block->work);
+        scicos_free(*work);
     }
     else  if (flag == 1)
     {
-        rw = *block->work;
+        rw = *work;
         t = get_scicos_time();
         if (t > rw[1])
         {
index b27802f..b7c9411 100644 (file)
 static double c_b4 = 1.;
 static double c_b5 = 0.;
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgemm)(); /* blas routine */
+typedef int integer;
+typedef double doublereal;
+extern int C2F(dgemm)(char *transa, char *transb, integer *m, integer *
+                      n, integer *k, doublereal *alpha, doublereal *a, integer *lda,
+                      doublereal *b, integer *ldb, doublereal *beta, doublereal *c, integer
+                      *ldc); /* blas routine */
 /*--------------------------------------------------------------------------*/
 int dmmul(double *a, int *na, double *b, int *nb, double *c__,
           int *nc, int *l, int *m, int *n)
index 8e47ff2..1a2b9ca 100644 (file)
@@ -23,7 +23,8 @@
 #include "dynlib_scicos_blocks.h"
 /* Table of constant values */
 /*--------------------------------------------------------------------------*/
-extern int C2F(dmmul1)(); /* in elementary_functions */
+extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__,
+                       int *nc, int *l, int *m, int *n); /* in elementary_functions */
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP int dmmul1(double *a, int *na, double *b, int *nb, double *c__,
                                 int *nc, int *l, int *m, int *n)
index 943d46b..06339ec 100644 (file)
@@ -41,6 +41,7 @@ SCICOS_BLOCKS_IMPEXP void dollar4_m(scicos_block *block, int flag)
 
     int m = 0, n = 0;
     double *y = NULL, *u = NULL, *oz = NULL;
+    dol_struct** work = (dol_struct**) block->work;
     dol_struct *ptr = NULL;
     m = GetInPortRows(block, 1);
     n = GetInPortCols(block, 1);
@@ -50,24 +51,24 @@ SCICOS_BLOCKS_IMPEXP void dollar4_m(scicos_block *block, int flag)
 
     if (flag == 4)
     {
-        *(block->work) = (dol_struct*) scicos_malloc(sizeof(dol_struct));
-        ptr = *(block->work);
+        *work = (dol_struct*) scicos_malloc(sizeof(dol_struct));
+        ptr = *work;
         /*     ptr->s=(int) scicos_malloc(sizeof(int));*/
         ptr->s = GetSizeOfOz(block, 1);
     }
     if (flag == 1 || flag == 6)
     {
-        ptr = *(block->work);
+        ptr = *work;
         memcpy(y, oz, m * n * (ptr->s));
     }
     if (flag == 2)
     {
-        ptr = *(block->work);
+        ptr = *work;
         memcpy(oz, u, m * n * ptr->s);
     }
     if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr != NULL)
         {
             scicos_free(ptr);
index 4b5889a..aef7139 100644 (file)
 #include "scicos_free.h"
 #include "scicos_malloc.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dmmul)();
-extern int C2F(dmmul1)();
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
+extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__,
+                       int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void dsslti4(scicos_block *block, int flag)
 {
@@ -99,7 +101,7 @@ SCICOS_BLOCKS_IMPEXP void dsslti4(scicos_block *block, int flag)
         /* x+=a*x+b*u */
         if (nz > 0)
         {
-            w = *block->work;
+            w = (double*) *block->work;
             memcpy(w, z, nz * sizeof(double));
             C2F(dmmul)(&rpar[0], &nz, w, &nz, z, &nz, &nz, &nz, &un);
             if (nin > 0)
index 55409a0..fc7fd4b 100644 (file)
@@ -25,6 +25,7 @@
 #include "scicos_malloc.h"
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
+
 /*--------------------------------------------------------------------------*/
 /*    Copyright INRIA
  *    Scicos block simulator
 SCICOS_BLOCKS_IMPEXP void evtdly4(scicos_block *block, int flag)
 {
     double t = 0.;
-    long long int *i = NULL;
+    time_counter_t** work = (time_counter_t**) block->work;
+    time_counter_t* i = NULL;
 
     switch (flag)
     {
             /* init */
         case 4  :  /* the workspace is used to store discrete counter value */
         {
-            if ((*block->work = scicos_malloc(sizeof(long long int))) == NULL)
+            if ((*work = (time_counter_t*) scicos_malloc(sizeof(time_counter_t))) == NULL)
             {
                 set_block_error(-16);
                 return;
             }
-            i = *block->work;
+            i = *work;
             (*i) = 0;
             break;
         }
@@ -55,7 +57,7 @@ SCICOS_BLOCKS_IMPEXP void evtdly4(scicos_block *block, int flag)
         {
             double dt;
 
-            i = *block->work;
+            i = *work;
             t = get_scicos_time();
             (*i)++; /*increase counter*/
             dt = block->rpar[1] + (*i) * block->rpar[0] - t;
@@ -71,7 +73,7 @@ SCICOS_BLOCKS_IMPEXP void evtdly4(scicos_block *block, int flag)
         /* finish */
         case 5  :
         {
-            scicos_free(*block->work); /*free the workspace*/
+            scicos_free(*work); /*free the workspace*/
             break;
         }
 
index f49c10d..eefa6a9 100644 (file)
@@ -28,10 +28,9 @@ SCICOS_BLOCKS_IMPEXP void extract(scicos_block *block, int flag)
     double *u = NULL;
     double *y = NULL;
     int *r = NULL;
-    int nu = 0, mu = 0, nr = 0, i = 0, j = 0, ij = 0, k = 0, nc = 0, nl = 0;
+    int mu = 0, nr = 0, i = 0, j = 0, ij = 0, k = 0, nc = 0, nl = 0;
 
     mu = GetInPortRows(block, 1);
-    nu = GetInPortCols(block, 1);
     nr = GetNipar(block);
     r = GetIparPtrs(block);
     u = GetRealInPortPtrs(block, 1);
index d64f544..f7598c5 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_16_LSB(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0;
+    int i = 0;
     short *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint16OutPortPtrs(block, 1);
     u = Getint16InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 16;
     ref = 0;
     for (i = 0; i < *ipar; i++)
     {
index 751ab96..fb38d57 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_16_RB0(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     short *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint16OutPortPtrs(block, 1);
     u = Getint16InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 16;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
@@ -42,4 +41,4 @@ SCICOS_BLOCKS_IMPEXP void extract_bit_16_RB0(scicos_block *block, int flag)
     }
     *y = (*u) & (ref);
 }
-/*--------------------------------------------------------------------------*/
\ No newline at end of file
+/*--------------------------------------------------------------------------*/
index 6dbc6d9..39152a3 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_16_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     short *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint16OutPortPtrs(block, 1);
     u = Getint16InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 16;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index dcb4822..8b9a8b0 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_32_LSB(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0;
+    int i = 0;
     SCSINT32_COP *y, *u, ref, n;
     int *ipar;
     y = Getint32OutPortPtrs(block, 1);
     u = Getint32InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 32;
     ref = 0;
     for (i = 0; i < *ipar; i++)
     {
index 5296207..28b2d48 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_32_RB0(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     SCSINT32_COP *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint32OutPortPtrs(block, 1);
     u = Getint32InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 32;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 8fd7d88..436834e 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_32_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     SCSINT32_COP *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint32OutPortPtrs(block, 1);
     u = Getint32InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 32;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 99b5138..3b8d6dd 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_8_LSB(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0;
+    int i = 0;
     char *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint8OutPortPtrs(block, 1);
     u = Getint8InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 8;
     ref = 0;
     for (i = 0; i < *ipar; i++)
     {
index cba1c1d..45af786 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_8_RB0(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     char *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getint8OutPortPtrs(block, 1);
     u = Getint8InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 8;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 5579acd..0d909a0 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_8_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     char *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
 
     y = Getint8OutPortPtrs(block, 1);
     u = Getint8InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 8;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 9b324c9..33ad5fa 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_u16_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     unsigned short *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getuint16OutPortPtrs(block, 1);
     u = Getuint16InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 16;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 632d276..e8f248b 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_u32_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     SCSUINT32_COP *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getuint32OutPortPtrs(block, 1);
     u = Getuint32InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 32;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 34c8aa5..ddaf828 100644 (file)
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void extract_bit_u8_RB1(scicos_block *block, int flag)
 {
-    int i = 0, maxim = 0, numb = 0;
+    int i = 0, numb = 0;
     unsigned char *y = NULL, *u = NULL, ref = 0, n = 0;
     int *ipar = NULL;
     y = Getuint8OutPortPtrs(block, 1);
     u = Getuint8InPortPtrs(block, 1);
     ipar = GetIparPtrs(block);
-    maxim = 8;
     ref = 0;
     numb = *(ipar + 1) - *ipar + 1;
     for (i = 0; i < numb; i++)
index 51fa34a..fa18ccc 100644 (file)
@@ -30,10 +30,9 @@ SCICOS_BLOCKS_IMPEXP void extractz(scicos_block *block, int flag)
     double *yr = NULL;
     double *yi = NULL;
     int *r = NULL;
-    int nu = 0, mu = 0, nr = 0, i = 0, j = 0, ij = 0, k = 0, nc = 0, nl = 0;
+    int mu = 0, nr = 0, i = 0, j = 0, ij = 0, k = 0, nc = 0, nl = 0;
 
     mu = GetInPortRows(block, 1);
-    nu = GetInPortCols(block, 1);
     nr = GetNipar(block);
     r = GetIparPtrs(block);
     ur = GetRealInPortPtrs(block, 1);
index 6edb0ce..3d4cde5 100644 (file)
@@ -122,6 +122,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
     SCSUINT32_COP *y_ul = NULL, *ptr_ul = NULL;
 
     /* the struct ptr of that block */
+    fromwork_struct** work = (fromwork_struct**) block->work;
     fromwork_struct *ptr = NULL;
 
     /* for path of TMPDIR/workspace */
@@ -141,7 +142,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
         str[Fnlength] = '\0';
 
         /* retrieve path of TMPDIR/workspace */
-        env = scicos_malloc(sizeof(filePrefix) + Fnlength);
+        env = (char*) scicos_malloc(sizeof(filePrefix) + Fnlength);
         if (env == NULL)
         {
             set_block_error(-16);
@@ -314,13 +315,13 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
         }
 
         /* allocation of the work structure of that block */
-        if ((*(block->work) = (fromwork_struct*) scicos_malloc(sizeof(fromwork_struct))) == NULL)
+        if ((*work = (fromwork_struct*) scicos_malloc(sizeof(fromwork_struct))) == NULL)
         {
             set_block_error(-16);
             C2F(mclose)(&fd, &res);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         ptr->D = NULL;
         ptr->workt = NULL;
         ptr->work = NULL;
@@ -455,7 +456,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
         {
             Coserror(_("The Time vector has a wrong size, expecting [%d, %d] and getting [%d, %d].\n"), nPoints, 1, Ydim[7], Ydim[8]);
             /*set_block_error(-3);*/
-            *(block->work) = NULL;
+            *work = NULL;
             scicos_free(ptr->work);
             scicos_free(ptr);
             C2F(mclose)(&fd, &res);
@@ -466,7 +467,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
         {
             sciprint(_("The Time vector type is not ""double"".\n"));
             set_block_error(-3);
-            *(block->work) = NULL;
+            *work = NULL;
             scicos_free(ptr->work);
             scicos_free(ptr);
             C2F(mclose)(&fd, &res);
@@ -476,7 +477,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
         if ((ptr->workt = (double *) scicos_malloc(nPoints * sizeof(double))) == NULL)
         {
             set_block_error(-16);
-            *(block->work) = NULL;
+            *work = NULL;
             scicos_free(ptr->work);
             scicos_free(ptr);
             C2F(mclose)(&fd, &res);
@@ -496,7 +497,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
             {
                 Coserror(_("The time vector should be an increasing vector.\n"));
                 /*set_block_error(-3);*/
-                *(block->work) = NULL;
+                *work = NULL;
                 scicos_free(ptr->workt);
                 scicos_free(ptr->work);
                 scicos_free(ptr);
@@ -512,7 +513,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
                 if ((ptr->D = (double *) scicos_malloc(nPoints * mY * sizeof(double))) == NULL)
                 {
                     set_block_error(-16);
-                    *(block->work) = NULL;
+                    *work = NULL;
                     scicos_free(ptr->workt);
                     scicos_free(ptr->work);
                     scicos_free(ptr);
@@ -525,7 +526,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
                 if ((ptr->D = (double *) scicos_malloc(2 * nPoints * mY * sizeof(double))) == NULL)
                 {
                     set_block_error(-16);
-                    *(block->work) = NULL;
+                    *work = NULL;
                     scicos_free(ptr->workt);
                     scicos_free(ptr->work);
                     scicos_free(ptr);
@@ -537,7 +538,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
             {
                 Coserror(_("Allocation problem in spline.\n"));
                 /*set_block_error(-16);*/
-                *(block->work) = NULL;
+                *work = NULL;
                 scicos_free(ptr->D);
                 scicos_free(ptr->workt);
                 scicos_free(ptr->work);
@@ -664,7 +665,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
 
 
         /* retrieve ptr of the structure of that block */
-        ptr = *(block->work);
+        ptr = *work;
         nPoints = ptr->nPoints;
         cnt1 = ptr->cnt1;
         cnt2 = ptr->cnt2;
@@ -1360,7 +1361,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
     {
         /* event date computation */
         /* retrieve ptr of the structure of that block */
-        ptr = *(block->work);
+        ptr = *work;
         nPoints = ptr->nPoints;
         cnt1 = ptr->cnt1;
         cnt2 = ptr->cnt2;
@@ -1453,7 +1454,7 @@ SCICOS_BLOCKS_IMPEXP void fromws_c(scicos_block *block, int flag)
     else if (flag == 5)
     {
         /* finish */
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr != NULL)
         {
             if (ptr->D != NULL)
index fc8ce26..442391e 100644 (file)
@@ -45,6 +45,7 @@ static int FindIndex(int, double , int , int , double *, int);
 SCICOS_BLOCKS_IMPEXP void lookup_c(scicos_block *block, int flag)
 {
     double a = 0., b = 0., c = 0., y1 = 0., y2 = 0., t1 = 0., t2 = 0.;
+    int** work = (int**) block->work;
     int *ind  = NULL, inow = 0, i = 0, ip1 = 0;
     double *y = NULL, *u = NULL, u0 = 0.;
     double  d1 = 0., d2 = 0., h = 0., dh = 0., ddh = 0., dddh = 0.;
@@ -54,12 +55,12 @@ SCICOS_BLOCKS_IMPEXP void lookup_c(scicos_block *block, int flag)
             /* init */
         case 4  :  /* the workspace is used to store discrete counter value */
         {
-            if ((*block->work = scicos_malloc(1 * sizeof(int))) == NULL)
+            if ((*work = (int*) scicos_malloc(1 * sizeof(int))) == NULL)
             {
                 set_block_error(-16);
                 return;
             }
-            ind = *block->work;
+            ind = *work;
             ind[0] = 0;
 
             return;
@@ -70,7 +71,7 @@ SCICOS_BLOCKS_IMPEXP void lookup_c(scicos_block *block, int flag)
             y = GetRealOutPortPtrs(block, 1);
             u = GetRealInPortPtrs(block, 1);
             u0 = u[0];
-            ind = *block->work;
+            ind = *work;
             i = ind[0];
             ip1 = i + 1;
 
@@ -199,7 +200,7 @@ SCICOS_BLOCKS_IMPEXP void lookup_c(scicos_block *block, int flag)
         /* finish */
         case 5  :
         {
-            scicos_free(*block->work); /*free the workspace*/
+            scicos_free(*work); /*free the workspace*/
             break;
         }
 
index cada8b2..d94186d 100644 (file)
@@ -33,7 +33,8 @@ SCICOS_BLOCKS_IMPEXP void m_frequ(scicos_block *block, int flag)
     double *off = NULL;
     SCSINT32_COP *icount = NULL;
     double t = 0.0;
-    long long *counter = NULL;
+    time_counter_t** work = (time_counter_t**) block->work;
+    time_counter_t *counter = NULL;
     int m = 0;
     mat = GetRealOparPtrs(block, 1);
     Dt = GetRealOparPtrs(block, 2);
@@ -46,12 +47,12 @@ SCICOS_BLOCKS_IMPEXP void m_frequ(scicos_block *block, int flag)
 
         case 4 :   /* the workspace is used to store discrete counter value */
         {
-            if ((*block->work = scicos_malloc(sizeof(long long int) * 2)) == NULL)
+            if ((*work = (time_counter_t*) scicos_malloc(sizeof(time_counter_t) * 2)) == NULL)
             {
                 set_block_error(-16);
                 return;
             }
-            counter = *block->work;
+            counter = *work;
             *counter = *icount;
             (*(counter + 1)) = 0;
             break;
@@ -60,7 +61,7 @@ SCICOS_BLOCKS_IMPEXP void m_frequ(scicos_block *block, int flag)
         /* event date computation */
         case 3  :
         {
-            counter = *block->work;
+            counter = *work;
             t = get_scicos_time();
             *counter += (int)mat[*(counter + 1)]; /*increase counter*/
             block->evout[(int)mat[*(counter + 1) + m] - 1] = *off + ((double) * counter / (*Dt)) - t;
@@ -72,7 +73,7 @@ SCICOS_BLOCKS_IMPEXP void m_frequ(scicos_block *block, int flag)
         /* finish */
         case 5  :
         {
-            scicos_free(*block->work); /*free the workspace*/
+            scicos_free(*work); /*free the workspace*/
             break;
         }
 
index ab4d8e0..e7b17e9 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgetrf)();
-extern double C2F(dlamch)();
-extern double C2F(dlange)();
-extern int C2F(dlacpy)();
-extern int C2F(dgecon)();
-extern int C2F(dgetrs)();
-extern int C2F(dgelsy1)();
+extern int C2F(dgetrf)(int *m, int *n, double *a, int *
+                       lda, int *ipiv, int *info);
+extern double C2F(dlamch)(char *cmach);
+extern double C2F(dlange)(char *norm, int *m, int *n, double *a, int
+                          *lda, double *work);
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dgecon)(char *norm, int *n, double *a, int *
+                       lda, double *anorm, double *rcond, double *work, int *
+                       iwork, int *info);
+extern int C2F(dgetrs)(char *trans, int *n, int *nrhs,
+                       double *a, int *lda, int *ipiv, double *b, int *
+                       ldb, int *info);
+extern int C2F(dgelsy1)(int *m, int *n, int *nrhs, double *a, int *
+                        lda, double *b, int *ldb, int *jpvt, double *rcond, int *rank, double *work, int *lwork, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -60,6 +68,7 @@ SCICOS_BLOCKS_IMPEXP void mat_bksl(scicos_block *block, int flag)
     int nu2 = 0;
     int info = 0;
     int i = 0, l = 0, lw = 0, lu = 0;
+    mat_bksl_struct** work = (mat_bksl_struct**) block->work;
     mat_bksl_struct *ptr = NULL;
     double rcond = 0., ANORM = 0., EPS = 0.;
 
@@ -75,12 +84,12 @@ SCICOS_BLOCKS_IMPEXP void mat_bksl(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
+        if ((*work = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu1)) == NULL)
         {
             set_block_error(-16);
@@ -163,7 +172,7 @@ SCICOS_BLOCKS_IMPEXP void mat_bksl(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr->LXB != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -181,8 +190,8 @@ SCICOS_BLOCKS_IMPEXP void mat_bksl(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
-        EPS = C2F(dlamch)("e", 1L);
+        ptr = *work;
+        EPS = C2F(dlamch)("e");
         ANORM = C2F(dlange)("1", &mu, &nu1, u1, &mu, ptr->dwork);
         C2F(dlacpy)("F", &mu, &nu1, u1, &mu, ptr->LA, &mu);
         if (mu == nu1)
index 1d9ea91..2c5e841 100644 (file)
@@ -28,7 +28,8 @@
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgetrf)();
+extern int C2F(dgetrf)(int *m, int *n, double *a, int *
+                       lda, int *ipiv, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -44,6 +45,7 @@ SCICOS_BLOCKS_IMPEXP void mat_det(scicos_block *block, int flag)
     int info = 0;
     int i = 0;
     double D = 0., l = 0.;
+    mat_det_struct** work = (mat_det_struct**) block->work;
     mat_det_struct *mdet = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -53,12 +55,12 @@ SCICOS_BLOCKS_IMPEXP void mat_det(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_det_struct*) scicos_malloc(sizeof(mat_det_struct))) == NULL)
+        if ((*work = (mat_det_struct*) scicos_malloc(sizeof(mat_det_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        mdet = *(block->work);
+        mdet = *work;
         if ((mdet->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -77,7 +79,7 @@ SCICOS_BLOCKS_IMPEXP void mat_det(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        mdet = *(block->work);
+        mdet = *work;
         if (mdet->wrk != NULL)
         {
             scicos_free(mdet->ipiv);
@@ -89,7 +91,7 @@ SCICOS_BLOCKS_IMPEXP void mat_det(scicos_block *block, int flag)
 
     else
     {
-        mdet = *(block->work);
+        mdet = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             mdet->wrk[i] = u[i];
index 0096631..ee338ad 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgetrf)();
-extern double C2F(dlamch)();
-extern double C2F(dlange)();
-extern int C2F(dlacpy)();
-extern int C2F(dgecon)();
-extern int C2F(dgetrs)();
-extern int C2F(dgelsy1)();
+extern int C2F(dgetrf)(int *m, int *n, double *a, int *
+                       lda, int *ipiv, int *info);
+extern double C2F(dlamch)(char *cmach);
+extern double C2F(dlange)(char *norm, int *m, int *n, double *a, int
+                          *lda, double *work);
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dgecon)(char *norm, int *n, double *a, int *
+                       lda, double *anorm, double *rcond, double *work, int *
+                       iwork, int *info);
+extern int C2F(dgetrs)(char *trans, int *n, int *nrhs,
+                       double *a, int *lda, int *ipiv, double *b, int *
+                       ldb, int *info);
+extern int C2F(dgelsy1)(int *m, int *n, int *nrhs, double *a, int *
+                        lda, double *b, int *ldb, int *jpvt, double *rcond, int *rank, double *work, int *lwork, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -56,16 +64,16 @@ SCICOS_BLOCKS_IMPEXP void mat_div(scicos_block *block, int flag)
     double *u2 = NULL;
     double *y = NULL;
     int mu1 = 0, mu2 = 0;
-    int nu = 0, nu2 = 0;
+    int nu = 0;
     int info = 0;
     int i = 0, j = 0, l = 0, lw = 0, lu = 0, ij = 0, ji = 0;
+    mat_div_struct** work = (mat_div_struct**) block->work;
     mat_div_struct *ptr = NULL;
     double rcond = 0., ANORM = 0., EPS = 0.;
 
     mu2 = GetInPortRows(block, 1);
     nu = GetInPortCols(block, 1);
     mu1 = GetInPortRows(block, 2);
-    nu2 = GetInPortCols(block, 2);
     u2 = GetRealInPortPtrs(block, 1);
     u1 = GetRealInPortPtrs(block, 2);
     y = GetRealOutPortPtrs(block, 1);
@@ -75,12 +83,12 @@ SCICOS_BLOCKS_IMPEXP void mat_div(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_div_struct*) scicos_malloc(sizeof(mat_div_struct))) == NULL)
+        if ((*work = (mat_div_struct*) scicos_malloc(sizeof(mat_div_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -162,7 +170,7 @@ SCICOS_BLOCKS_IMPEXP void mat_div(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LAT) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -180,8 +188,8 @@ SCICOS_BLOCKS_IMPEXP void mat_div(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
-        EPS = C2F(dlamch)("e", 1L);
+        ptr = *work;
+        EPS = C2F(dlamch)("e");
         ANORM = C2F(dlange)("l", &mu1, &nu, u1, &mu1, ptr->dwork);
         for (j = 0; j < mu1; j++)
         {
index 4a94630..c03a9c0 100644 (file)
@@ -29,7 +29,7 @@
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dexpm1)();
+extern int C2F(dexpm1)(int* ia, int* n, double* a, double* ea, int* iea, double* w, int* iw, int* ierr);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -43,6 +43,7 @@ SCICOS_BLOCKS_IMPEXP void mat_expm(scicos_block *block, int flag)
     double *y = NULL;
     int nu = 0;
     int ierr = 0;
+    mat_exp_struct** work = (mat_exp_struct**) block->work;
     mat_exp_struct *ptr = NULL;
 
     nu = GetInPortCols(block, 1);
@@ -52,12 +53,12 @@ SCICOS_BLOCKS_IMPEXP void mat_expm(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_exp_struct*) scicos_malloc(sizeof(mat_exp_struct))) == NULL)
+        if ((*work = (mat_exp_struct*) scicos_malloc(sizeof(mat_exp_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->iwork = (int*) scicos_malloc(sizeof(int) * (2 * nu))) == NULL)
         {
             set_block_error(-16);
@@ -76,7 +77,7 @@ SCICOS_BLOCKS_IMPEXP void mat_expm(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr->dwork != NULL)
         {
             scicos_free(ptr->iwork);
@@ -88,7 +89,7 @@ SCICOS_BLOCKS_IMPEXP void mat_expm(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(dexpm1)(&nu, &nu, u, y, &nu, ptr->dwork, ptr->iwork, &ierr);
         if (ierr != 0)
         {
index 7776940..989cfac 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgetrf) ();
-extern int C2F(dgetri) ();
+extern int C2F(dgetrf) (int *m, int *n, double *a, int *
+                        lda, int *ipiv, int *info);
+extern int C2F(dgetri) (int *n, double *a, int *lda, int
+                        *ipiv, double *work, int *lwork, int *info);
 
 /*--------------------------------------------------------------------------*/
 typedef struct
@@ -49,6 +51,7 @@ SCICOS_BLOCKS_IMPEXP void mat_inv(scicos_block * block, int flag)
     int nu = 0;
     int info = 0;
     int i = 0;
+    mat_inv_struct** work = (mat_inv_struct**) block->work;
     mat_inv_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -58,12 +61,12 @@ SCICOS_BLOCKS_IMPEXP void mat_inv(scicos_block * block, int flag)
     /*init : initialization */
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_inv_struct *) scicos_malloc(sizeof(mat_inv_struct))) == NULL)
+        if ((*work = (mat_inv_struct *) scicos_malloc(sizeof(mat_inv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int *)scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -82,7 +85,7 @@ SCICOS_BLOCKS_IMPEXP void mat_inv(scicos_block * block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->dwork) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -94,7 +97,7 @@ SCICOS_BLOCKS_IMPEXP void mat_inv(scicos_block * block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             y[i] = u[i];
index d5c4773..50ecc3d 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgetrf)();
-extern int C2F(dlaswp)();
+extern int C2F(dgetrf)(int *m, int *n, double *a, int *
+                       lda, int *ipiv, int *info);
+extern int C2F(dlaswp)(int *n, double *a, int *lda, int
+                       *k1, int *k2, int *ipiv, int *incx);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -49,6 +51,7 @@ SCICOS_BLOCKS_IMPEXP void mat_lu(scicos_block *block, int flag)
     int nu = 0;
     int info = 0;
     int i = 0, j = 0, l = 0, ij = 0, ik = 0;
+    mat_lu_struct** work = (mat_lu_struct**) block->work;
     mat_lu_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -60,12 +63,12 @@ SCICOS_BLOCKS_IMPEXP void mat_lu(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_lu_struct*) scicos_malloc(sizeof(mat_lu_struct))) == NULL)
+        if ((*work = (mat_lu_struct*) scicos_malloc(sizeof(mat_lu_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -101,7 +104,7 @@ SCICOS_BLOCKS_IMPEXP void mat_lu(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->IU) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -115,7 +118,7 @@ SCICOS_BLOCKS_IMPEXP void mat_lu(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu); i++)
         {
             ptr->dwork[i] = u[i];
index 13d4e59..b691efc 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgesvd)();
-extern int C2F(dlaset)();
-extern int C2F(dlacpy)();
-extern int C2F(dmmul)();
+extern int C2F(dgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u, int *
+                       ldu, double *vt, int *ldvt, double *work, int *lwork,
+                       int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -56,6 +62,7 @@ SCICOS_BLOCKS_IMPEXP void mat_pinv(scicos_block *block, int flag)
     int nu = 0, mu = 0;
     int info = 0;
     int i = 0, j = 0, ij = 0, ji = 0, ii = 0, lwork = 0;
+    mat_pinv_struct** work = (mat_pinv_struct**) block->work;
     mat_pinv_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -70,12 +77,12 @@ SCICOS_BLOCKS_IMPEXP void mat_pinv(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_pinv_struct*) scicos_malloc(sizeof(mat_pinv_struct))) == NULL)
+        if ((*work = (mat_pinv_struct*) scicos_malloc(sizeof(mat_pinv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->l0 = (double*) scicos_malloc(sizeof(double))) == NULL)
         {
             set_block_error(-16);
@@ -202,7 +209,7 @@ SCICOS_BLOCKS_IMPEXP void mat_pinv(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->dwork) != 0)
         {
             scicos_free(ptr->LC);
@@ -223,7 +230,7 @@ SCICOS_BLOCKS_IMPEXP void mat_pinv(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < mu * nu; i++)
         {
             y[i] = 0;
index b3bbac4..bad1d3e 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgesvd)();
-extern int C2F(dlaset)();
-extern int C2F(dlacpy)();
+extern int C2F(dgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u, int *
+                       ldu, double *vt, int *ldvt, double *work, int *lwork,
+                       int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -48,6 +53,7 @@ SCICOS_BLOCKS_IMPEXP void mat_sing(scicos_block *block, int flag)
     int nu = 0, mu = 0;
     int info = 0;
     int lwork = 0;
+    mat_sing_struct** work = (mat_sing_struct**) block->work;
     mat_sing_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -60,12 +66,12 @@ SCICOS_BLOCKS_IMPEXP void mat_sing(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_sing_struct*) scicos_malloc(sizeof(mat_sing_struct))) == NULL)
+        if ((*work = (mat_sing_struct*) scicos_malloc(sizeof(mat_sing_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (mu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -101,7 +107,7 @@ SCICOS_BLOCKS_IMPEXP void mat_sing(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr->dwork != 0)
         {
             scicos_free(ptr->LA);
@@ -115,7 +121,7 @@ SCICOS_BLOCKS_IMPEXP void mat_sing(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(dlacpy)("F", &mu, &nu, u, &mu, ptr->LA, &mu);
         C2F(dgesvd)("A", "A", &mu, &nu, ptr->LA, &mu, y, ptr->LU, &mu, ptr->LVT, &nu, ptr->dwork, &lwork, &info);
         if (info != 0)
index 20771c1..44d0bd2 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dgesvd)();
-extern int C2F(dlaset)();
-extern int C2F(dlacpy)();
-extern int C2F(dmmul)();
+extern int C2F(dgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u, int *
+                       ldu, double *vt, int *ldvt, double *work, int *lwork,
+                       int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -50,6 +56,7 @@ SCICOS_BLOCKS_IMPEXP void mat_svd(scicos_block *block, int flag)
     int nu = 0, mu = 0;
     int info = 0;
     int i = 0, j = 0, ij = 0, ji = 0, ii = 0, lwork = 0;
+    mat_sdv_struct** work = (mat_sdv_struct**) block->work;
     mat_sdv_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -64,12 +71,12 @@ SCICOS_BLOCKS_IMPEXP void mat_svd(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_sdv_struct*) scicos_malloc(sizeof(mat_sdv_struct))) == NULL)
+        if ((*work = (mat_sdv_struct*) scicos_malloc(sizeof(mat_sdv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->l0 = (double*) scicos_malloc(sizeof(double))) == NULL)
         {
             set_block_error(-16);
@@ -115,7 +122,7 @@ SCICOS_BLOCKS_IMPEXP void mat_svd(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->dwork) != NULL)
         {
             scicos_free(ptr->l0);
@@ -130,7 +137,7 @@ SCICOS_BLOCKS_IMPEXP void mat_svd(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(dlacpy)("F", &mu, &nu, u, &mu, ptr->LA, &mu);
         C2F(dgesvd)("A", "A", &mu, &nu, ptr->LA, &mu, ptr->LSV, y1, &mu, ptr->LVT, &nu, ptr->dwork, &lwork, &info);
         if (info != 0)
index c30af27..6e1b712 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dlacpy)();
-extern int C2F(dgeev)();
-extern int C2F(zlaset)();
-extern int C2F(dsyev)();
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dgeev)(char *jobvl, char *jobvr, int *n, double *
+                      a, int *lda, double *wr, double *wi, double *vl,
+                      int *ldvl, double *vr, int *ldvr, double *work,
+                      int *lwork, int *info);
+extern int C2F(zlaset)(char *uplo, int *m, int *n,
+                       double *alpha, double *beta, double *a, int *
+                       lda);
+extern int C2F(dsyev)(char *jobz, char *uplo, int *n, double *a,
+                      int *lda, double *w, double *work, int *lwork,
+                      int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -51,6 +59,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vps(scicos_block *block, int flag)
     int info = 0;
     int i = 0, lwork = 0, lwork1 = 0, j = 0, ij = 0, ji = 0;
     int symmetric = 0;
+    mat_vps_struct** work = (mat_vps_struct**) block->work;
     mat_vps_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -62,12 +71,12 @@ SCICOS_BLOCKS_IMPEXP void mat_vps(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
+        if ((*work = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (nu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -103,7 +112,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vps(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->dwork1) != NULL)
         {
             scicos_free(ptr->LA);
@@ -117,7 +126,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vps(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(dlacpy)("F", &nu, &nu, u, &nu, ptr->LA, &nu);
         symmetric = 1;
         for (j = 0; j < nu; j++)
index bcfdca2..8a76e7c 100644 (file)
 #include "scicos_free.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dlacpy)();
-extern int C2F(dgeev)();
-extern int C2F(dlaset)();
-extern int C2F(dsyev)();
+extern int C2F(dlacpy)(char *uplo, int *m, int *n, double *
+                       a, int *lda, double *b, int *ldb);
+extern int C2F(dgeev)(char *jobvl, char *jobvr, int *n, double *
+                      a, int *lda, double *wr, double *wi, double *vl,
+                      int *ldvl, double *vr, int *ldvr, double *work,
+                      int *lwork, int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
+extern int C2F(dsyev)(char *jobz, char *uplo, int *n, double *a,
+                      int *lda, double *w, double *work, int *lwork,
+                      int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -56,6 +63,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vpv(scicos_block *block, int flag)
     int info = 0;
     int i = 0, j = 0, lwork = 0, lwork1 = 0, ii = 0, ij = 0, ij1 = 0, ji = 0;
     int symmetric = 0;
+    mat_vps_struct** work = (mat_vps_struct**) block->work;
     mat_vps_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -69,12 +77,12 @@ SCICOS_BLOCKS_IMPEXP void mat_vpv(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
+        if ((*work = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (nu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -156,7 +164,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vpv(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr->dwork1 != NULL)
         {
             scicos_free(ptr->LA);
@@ -174,7 +182,7 @@ SCICOS_BLOCKS_IMPEXP void mat_vpv(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(dlacpy)("F", &nu, &nu, u, &nu, ptr->LA, &nu);
         symmetric = 1;
         for (j = 0; j < nu; j++)
index d4326f1..5127179 100644 (file)
@@ -23,7 +23,7 @@
 #include "machine.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(mtran)();
+extern int C2F(mtran)(double* a, int* na, double* b, int* nb, int* m, int* n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void mathermit_m(scicos_block *block, int flag)
 {
index ffd7628..629429c 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i32s(scicos_block *block, int flag)
         SCSINT32_COP *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,8 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i32s(scicos_block *block, int flag)
         u1 = Getint32InPortPtrs(block, 1);
         u2 = Getint32InPortPtrs(block, 2);
         y = Getint32OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
-
         k = pow(2, 32);
         for (l = 0; l < nu2; l++)
         {
index 950a4c7..593c66a 100644 (file)
@@ -34,7 +34,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8e(scicos_block *block, int flag)
         char *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -42,7 +41,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8e(scicos_block *block, int flag)
         u1 = Getint8InPortPtrs(block, 1);
         u2 = Getint8InPortPtrs(block, 2);
         y = Getint8OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 8);
         for (l = 0; l < nu2; l++)
index c12f5fa..8f0671e 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8n(scicos_block *block, int flag)
         char *u1, *u2, *y;
         double C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,7 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8n(scicos_block *block, int flag)
         u1 = Getint8InPortPtrs(block, 1);
         u2 = Getint8InPortPtrs(block, 2);
         y = Getint8OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         for (l = 0; l < nu2; l++)
         {
index 6db23a1..397524a 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8s(scicos_block *block, int flag)
         char *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,7 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_i8s(scicos_block *block, int flag)
         u1 = Getint8InPortPtrs(block, 1);
         u2 = Getint8InPortPtrs(block, 2);
         y = Getint8OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 8);
         for (l = 0; l < nu2; l++)
index fdac122..d2e1785 100644 (file)
@@ -34,7 +34,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16e(scicos_block *block, int flag)
         unsigned short *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -42,7 +41,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16e(scicos_block *block, int flag)
         u1 = Getuint16InPortPtrs(block, 1);
         u2 = Getuint16InPortPtrs(block, 2);
         y = Getuint16OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 16);
         for (l = 0; l < nu2; l++)
index 92c4eb3..d52ffbc 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16n(scicos_block *block, int flag)
         unsigned short *u1, *u2, *y;
         double k, C, D, t;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,7 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16n(scicos_block *block, int flag)
         u1 = Getuint16InPortPtrs(block, 1);
         u2 = Getuint16InPortPtrs(block, 2);
         y = Getuint16OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 16);
         for (l = 0; l < nu2; l++)
index 0a00a53..c91452b 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16s(scicos_block *block, int flag)
         unsigned short *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,7 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui16s(scicos_block *block, int flag)
         u1 = Getuint16InPortPtrs(block, 1);
         u2 = Getuint16InPortPtrs(block, 2);
         y = Getuint16OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 16);
         for (l = 0; l < nu2; l++)
index 7f0fbf4..51f7491 100644 (file)
@@ -34,7 +34,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui32e(scicos_block *block, int flag)
         SCSUINT32_COP *u1, *u2, *y;
         double k, C, D;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -42,7 +41,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui32e(scicos_block *block, int flag)
         u1 = Getuint32InPortPtrs(block, 1);
         u2 = Getuint32InPortPtrs(block, 2);
         y = Getuint32OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 32);
         for (l = 0; l < nu2; l++)
index 246f10f..5142d28 100644 (file)
@@ -30,7 +30,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui32n(scicos_block *block, int flag)
         SCSUINT32_COP *u1, *u2, *y;
         double k, C, D, t;
         int mu1, nu1, nu2, i, j, l, ji, jl, il;
-        int *ipar;
 
         mu1 = GetInPortRows(block, 1);
         nu1 = GetInPortCols(block, 1);
@@ -38,7 +37,6 @@ SCICOS_BLOCKS_IMPEXP void matmul_ui32n(scicos_block *block, int flag)
         u1 = Getuint32InPortPtrs(block, 1);
         u2 = Getuint32InPortPtrs(block, 2);
         y = Getuint32OutPortPtrs(block, 1);
-        ipar = GetIparPtrs(block);
 
         k = pow(2, 32);
         for (l = 0; l < nu2; l++)
index ace50fa..9521ef3 100644 (file)
@@ -23,7 +23,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(mtran)();
+extern int C2F(mtran)(double* a, int* na, double* b, int* nb, int* m, int* n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void mattran_m(scicos_block *block, int flag)
 {
index 9062a9e..20b1853 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zlacpy)();
-extern int C2F(zgetrf)();
-extern double C2F(dlamch)();
-extern double C2F(zlange)();
-extern int C2F(zgecon)();
-extern int C2F(zgetrs)();
-extern int C2F(zgelsy1)();
+extern int C2F(zlacpy)(char *uplo, int *m, int *n,
+                       double *a, int *lda, double *b, int *ldb);
+extern int C2F(zgetrf)(int *m, int *n, double *a,
+                       int *lda, int *ipiv, int *info);
+extern double C2F(dlamch)(char *cmach);
+extern double C2F(zlange)(char *norm, int *m, int *n, double *a,
+                          int *lda, double *work);
+extern int C2F(zgecon)(char *norm, int *n, double *a,
+                       int *lda, double *anorm, double *rcond, double *
+                       work, double *rwork, int *info);
+extern int C2F(zgetrs)(char *trans, int *n, int *nrhs,
+                       double *a, int *lda, int *ipiv, double *b,
+                       int *ldb, int *info);
+extern int C2F(zgelsy1)(int* M, int* N, int* NRHS, double* A, int* LDA, double* B, int* LDB, int* JPVT, double* RCOND, int* RANK, double* WORK, int* LWORK, double* RWORK, int* INFO);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -60,7 +67,8 @@ SCICOS_BLOCKS_IMPEXP void matz_bksl(scicos_block *block, int flag)
     int nu1 = 0;
     int nu2 = 0;
     int info = 0;
-    int i = 0, j = 0, l = 0, lw = 0, lu = 0, rw = 0, ij = 0, k = 0;
+    int i = 0, j = 0, l = 0, lw = 0, lu = 0, ij = 0, k = 0;
+    mat_bksl_struct** work = (mat_bksl_struct**) block->work;
     mat_bksl_struct *ptr = NULL;
     double rcond = 0., ANORM = 0., EPS = 0.;
 
@@ -79,17 +87,16 @@ SCICOS_BLOCKS_IMPEXP void matz_bksl(scicos_block *block, int flag)
     lw = Max(2 * Min(mu, nu1), nu1 + 1);
     lu = Max(lw, Min(mu, nu1) + nu2);
     lw = Max(2 * nu1, Min(mu, nu1) + lu);
-    rw = 2 * nu1;
 
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
+        if ((*work = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu1)) == NULL)
         {
             set_block_error(-16);
@@ -185,7 +192,7 @@ SCICOS_BLOCKS_IMPEXP void matz_bksl(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->IN2) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -204,7 +211,7 @@ SCICOS_BLOCKS_IMPEXP void matz_bksl(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu1); i++)
         {
             ptr->IN1[2 * i] = u1r[i];
@@ -215,7 +222,7 @@ SCICOS_BLOCKS_IMPEXP void matz_bksl(scicos_block *block, int flag)
             ptr->IN2[2 * i] = u2r[i];
             ptr->IN2[2 * i + 1] = u2i[i];
         }
-        EPS = C2F(dlamch)("e", 1L);
+        EPS = C2F(dlamch)("e");
         ANORM = C2F(zlange)("1", &mu, &nu1, ptr->IN1, &mu, ptr->dwork);
         if (mu == nu1)
         {
index 7191d4e..296d925 100644 (file)
@@ -28,7 +28,8 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgetrf)();
+extern int C2F(zgetrf)(int *m, int *n, double *a,
+                       int *lda, int *ipiv, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct FCOMPLEX
 {
@@ -52,6 +53,7 @@ SCICOS_BLOCKS_IMPEXP void matz_det(scicos_block *block, int flag)
     int i = 0;
     fcomplex D, l;
     double A = 0.;
+    mat_det_struct** work = (mat_det_struct**) block->work;
     mat_det_struct *mdet = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -62,12 +64,12 @@ SCICOS_BLOCKS_IMPEXP void matz_det(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_det_struct*) scicos_malloc(sizeof(mat_det_struct))) == NULL)
+        if ((*work = (mat_det_struct*) scicos_malloc(sizeof(mat_det_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        mdet = *(block->work);
+        mdet = *work;
         if ((mdet->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -86,7 +88,7 @@ SCICOS_BLOCKS_IMPEXP void matz_det(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        mdet = *(block->work);
+        mdet = *work;
         if (mdet->wrk != NULL)
         {
             scicos_free(mdet->ipiv);
@@ -98,7 +100,7 @@ SCICOS_BLOCKS_IMPEXP void matz_det(scicos_block *block, int flag)
 
     else
     {
-        mdet = *(block->work);
+        mdet = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             mdet->wrk[2 * i] = ur[i];
index 2fe8db1..c2e74a9 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zlacpy)();
-extern int C2F(zgetrf)();
-extern int C2F(mtran)();
-extern double C2F(dlamch)();
-extern double C2F(zlange)();
-extern int C2F(zgecon)();
-extern int C2F(zgetrs)();
-extern int C2F(zgelsy1)();
+extern int C2F(zlacpy)(char *uplo, int *m, int *n,
+                       double *a, int *lda, double *b, int *ldb);
+extern int C2F(zgetrf)(int *m, int *n, double *a,
+                       int *lda, int *ipiv, int *info);
+extern int C2F(mtran)(double* a, int* na, double* b, int* nb, int* m, int* n);
+extern double C2F(dlamch)(char *cmach);
+extern double C2F(zlange)(char *norm, int *m, int *n, double *a,
+                          int *lda, double *work);
+extern int C2F(zgecon)(char *norm, int *n, double *a,
+                       int *lda, double *anorm, double *rcond, double *
+                       work, double *rwork, int *info);
+extern int C2F(zgetrs)(char *trans, int *n, int *nrhs,
+                       double *a, int *lda, int *ipiv, double *b,
+                       int *ldb, int *info);
+extern int C2F(zgelsy1)(int* M, int* N, int* NRHS, double* A, int* LDA, double* B, int* LDB, int* JPVT, double* RCOND, int* RANK, double* WORK, int* LWORK, double* RWORK, int* INFO);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -64,7 +71,8 @@ SCICOS_BLOCKS_IMPEXP void matz_div(scicos_block *block, int flag)
     int nu = 0;
     int mu2 = 0;
     int info = 0;
-    int i = 0, l = 0, lw = 0, lu = 0, rw = 0;
+    int i = 0, l = 0, lw = 0, lu = 0;
+    mat_bksl_struct** work = (mat_bksl_struct**) block->work;
     mat_bksl_struct *ptr = NULL;
     double rcond = 0., ANORM = 0., EPS = 0.;
 
@@ -81,16 +89,16 @@ SCICOS_BLOCKS_IMPEXP void matz_div(scicos_block *block, int flag)
     lw = Max(2 * Min(mu1, nu), mu1 + 1);
     lu = Max(lw, Min(mu1, nu) + mu2);
     lw = Max(2 * nu, Min(mu1, nu) + lu);
-    rw = 2 * nu;
+
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
+        if ((*work = (mat_bksl_struct*) scicos_malloc(sizeof(mat_bksl_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -291,7 +299,7 @@ SCICOS_BLOCKS_IMPEXP void matz_div(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->yrT) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -316,7 +324,7 @@ SCICOS_BLOCKS_IMPEXP void matz_div(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(mtran)(u1r, &mu1, ptr->urT1, &nu, &mu1, &nu);
         C2F(mtran)(u1i, &mu1, ptr->uiT1, &nu, &mu1, &nu);
         C2F(mtran)(u2r, &mu2, ptr->urT2, &nu, &mu2, &nu);
@@ -332,7 +340,7 @@ SCICOS_BLOCKS_IMPEXP void matz_div(scicos_block *block, int flag)
             ptr->IN2[2 * i] = ptr->urT2[i];
             ptr->IN2[2 * i + 1] = -ptr->uiT2[i];
         }
-        EPS = C2F(dlamch)("e", 1L);
+        EPS = C2F(dlamch)("e");
         ANORM = C2F(zlange)("1", &nu, &mu1, ptr->IN1, &nu, ptr->dwork);
         if (mu1 == nu)
         {
index efabe9c..da9224e 100644 (file)
@@ -29,7 +29,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(wexpm1)();
+extern int C2F(wexpm1)(int* n, double* ar, double* ai, int* ia, double* ear, double* eai, int* iea, double* w, int* iw, int* ierr);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -43,6 +43,7 @@ SCICOS_BLOCKS_IMPEXP void matz_expm(scicos_block *block, int flag)
     double *yr = NULL, *yi = NULL;
     int nu = 0;
     int ierr = 0;
+    mat_exp_struct** work = (mat_exp_struct**) block->work;
     mat_exp_struct *ptr = NULL;
 
     nu = GetInPortCols(block, 1);
@@ -54,12 +55,12 @@ SCICOS_BLOCKS_IMPEXP void matz_expm(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_exp_struct*) scicos_malloc(sizeof(mat_exp_struct))) == NULL)
+        if ((*work = (mat_exp_struct*) scicos_malloc(sizeof(mat_exp_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->iwork = (int*) scicos_malloc(sizeof(int) * (2 * nu))) == NULL)
         {
             set_block_error(-16);
@@ -78,7 +79,7 @@ SCICOS_BLOCKS_IMPEXP void matz_expm(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ptr->dwork != NULL)
         {
             scicos_free(ptr->iwork);
@@ -90,7 +91,7 @@ SCICOS_BLOCKS_IMPEXP void matz_expm(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         C2F(wexpm1)(&nu, ur, ui, &nu, yr, yi, &nu, ptr->dwork, ptr->iwork, &ierr);
         if (ierr != 0)
         {
index 92386b9..513bcbc 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgetrf)();
-extern int C2F(zgetri)();
+extern int C2F(zgetrf)(int *m, int *n, double *a,
+                       int *lda, int *ipiv, int *info);
+extern int C2F(zgetri)(int *n, double *a, int *lda,
+                       int *ipiv, double *work, int *lwork, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -47,6 +49,7 @@ SCICOS_BLOCKS_IMPEXP void matz_inv(scicos_block *block, int flag)
     int nu = 0;
     int info = 0;
     int i = 0;
+    mat_inv_struct** work = (mat_inv_struct**) block->work;
     mat_inv_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -58,12 +61,12 @@ SCICOS_BLOCKS_IMPEXP void matz_inv(scicos_block *block, int flag)
     if (flag == 4)
 
     {
-        if ((*(block->work) = (mat_inv_struct*) scicos_malloc(sizeof(mat_inv_struct))) == NULL)
+        if ((*work = (mat_inv_struct*) scicos_malloc(sizeof(mat_inv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -90,7 +93,7 @@ SCICOS_BLOCKS_IMPEXP void matz_inv(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LX) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -103,7 +106,7 @@ SCICOS_BLOCKS_IMPEXP void matz_inv(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             ptr->LX[2 * i] = ur[i];
index c5dd495..7951bc2 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgetrf)();
-extern int C2F(dlaswp)();
+extern int C2F(zgetrf)(int *m, int *n, double *a,
+                       int *lda, int *ipiv, int *info);
+extern int C2F(dlaswp)(int *n, double *a, int *lda, int
+                       *k1, int *k2, int *ipiv, int *incx);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -52,6 +54,7 @@ SCICOS_BLOCKS_IMPEXP void matz_lu(scicos_block *block, int flag)
     int nu = 0;
     int info = 0;
     int i = 0, j = 0, l = 0, ij = 0, ik = 0, ij1 = 0;
+    mat_lu_struct** work = (mat_lu_struct**) block->work;
     mat_lu_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -66,12 +69,12 @@ SCICOS_BLOCKS_IMPEXP void matz_lu(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_lu_struct*) scicos_malloc(sizeof(mat_lu_struct))) == NULL)
+        if ((*work = (mat_lu_struct*) scicos_malloc(sizeof(mat_lu_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->ipiv = (int*) scicos_malloc(sizeof(int) * nu)) == NULL)
         {
             set_block_error(-16);
@@ -107,7 +110,7 @@ SCICOS_BLOCKS_IMPEXP void matz_lu(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->IU) != NULL)
         {
             scicos_free(ptr->ipiv);
@@ -121,7 +124,7 @@ SCICOS_BLOCKS_IMPEXP void matz_lu(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu); i++)
         {
             ptr->dwork[2 * i] = ur[i];
index 2be8c4a..fb3142c 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgesvd)();
-extern int C2F(wmmul)();
-extern int C2F(dlaset)();
+extern int C2F(zgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u,
+                       int *ldu, double *vt, int *ldvt, double *work,
+                       int *lwork, double *rwork, int *info);
+extern int C2F(wmmul)(double* Ar, double* Ai, int* na, double* Br, double* Bi, int* nb, double* Cr, double* Ci, int* nc, int* l, int* m, int* n);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -58,6 +62,7 @@ SCICOS_BLOCKS_IMPEXP void matz_pinv(scicos_block *block, int flag)
     int info = 0;
     int i = 0, j = 0, ij = 0, ji = 0, ii = 0, lwork = 0, rw = 0;
 
+    mat_pinv_struct** work = (mat_pinv_struct**) block->work;
     mat_pinv_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -71,12 +76,12 @@ SCICOS_BLOCKS_IMPEXP void matz_pinv(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_pinv_struct*) scicos_malloc(sizeof(mat_pinv_struct))) == NULL)
+        if ((*work = (mat_pinv_struct*) scicos_malloc(sizeof(mat_pinv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->l0 = (double*) scicos_malloc(sizeof(double))) == NULL)
         {
             set_block_error(-16);
@@ -298,7 +303,7 @@ SCICOS_BLOCKS_IMPEXP void matz_pinv(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->rwork) != NULL)
         {
             scicos_free(ptr->l0);
@@ -324,7 +329,7 @@ SCICOS_BLOCKS_IMPEXP void matz_pinv(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu); i++)
         {
             ptr->LA[2 * i] = ur[i];
index 7125322..3b9e246 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgesvd)();
+extern int C2F(zgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u,
+                       int *ldu, double *vt, int *ldvt, double *work,
+                       int *lwork, double *rwork, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -46,10 +49,10 @@ SCICOS_BLOCKS_IMPEXP void matz_sing(scicos_block *block, int flag)
     double *ur = NULL;
     double *ui = NULL;
     double *yr = NULL;
-    double *yi = NULL;
     int nu = 0, mu = 0;
     int info = 0;
     int i = 0, rw = 0, lwork = 0;
+    mat_sing_struct** work = (mat_sing_struct**) block->work;
     mat_sing_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -57,19 +60,18 @@ SCICOS_BLOCKS_IMPEXP void matz_sing(scicos_block *block, int flag)
     ur = GetRealInPortPtrs(block, 1);
     ui = GetImagInPortPtrs(block, 1);
     yr = GetRealOutPortPtrs(block, 1);
-    yi = GetImagOutPortPtrs(block, 1);
     lwork = Max(3 * Min(mu, nu) + Max(mu, nu), 5 * Min(mu, nu) - 4);
     rw = 5 * Min(mu, nu);
 
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_sing_struct*) scicos_malloc(sizeof(mat_sing_struct))) == NULL)
+        if ((*work = (mat_sing_struct*) scicos_malloc(sizeof(mat_sing_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (2 * mu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -126,7 +128,7 @@ SCICOS_BLOCKS_IMPEXP void matz_sing(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->rwork) != NULL)
         {
             scicos_free(ptr->LA);
@@ -142,7 +144,7 @@ SCICOS_BLOCKS_IMPEXP void matz_sing(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu); i++)
         {
             ptr->LA[2 * i] = ur[i];
index 5ae7306..b352622 100644 (file)
@@ -24,7 +24,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(wsqrt)();
+extern int C2F(wsqrt)(double* xr, double* xi, double* yr, double* yi);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void matz_sqrt(scicos_block *block, int flag)
 {
index 0919119..83e2462 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgesvd)();
-extern int C2F(dlaset)();
+extern int C2F(zgesvd)(char *jobu, char *jobvt, int *m, int *n,
+                       double *a, int *lda, double *s, double *u,
+                       int *ldu, double *vt, int *ldvt, double *work,
+                       int *lwork, double *rwork, int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -51,6 +55,7 @@ SCICOS_BLOCKS_IMPEXP void matz_svd(scicos_block *block, int flag)
     int nu = 0, mu = 0;
     int info = 0;
     int i = 0, j = 0, ij = 0, ji = 0, ii = 0, lwork = 0, rw = 0;
+    mat_sdv_struct** work = (mat_sdv_struct**) block->work;
     mat_sdv_struct *ptr = NULL;
 
     mu = GetInPortRows(block, 1);
@@ -69,12 +74,12 @@ SCICOS_BLOCKS_IMPEXP void matz_svd(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_sdv_struct*) scicos_malloc(sizeof(mat_sdv_struct))) == NULL)
+        if ((*work = (mat_sdv_struct*) scicos_malloc(sizeof(mat_sdv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->l0 = (double*) scicos_malloc(sizeof(double))) == NULL)
         {
             set_block_error(-16);
@@ -143,7 +148,7 @@ SCICOS_BLOCKS_IMPEXP void matz_svd(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->rwork) != NULL)
         {
             scicos_free(ptr->l0);
@@ -159,7 +164,7 @@ SCICOS_BLOCKS_IMPEXP void matz_svd(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (mu * nu); i++)
         {
             ptr->LA[2 * i] = ur[i];
index b504880..459f7e3 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgeev)();
-extern int C2F(zheev)();
+extern int C2F(zgeev)(char *jobvl, char *jobvr, int *n,
+                      double *a, int *lda, double *w, double *vl,
+                      int *ldvl, double *vr, int *ldvr, double *work,
+                      int *lwork, double *rwork, int *info);
+extern int C2F(zheev)(char *jobz, char *uplo, int *n, double
+                      *a, int *lda, double *w, double *work, int *lwork,
+                      double *rwork, int *info);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -50,6 +55,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vps(scicos_block *block, int flag)
     int info = 0;
     int i = 0, lwork = 0, lwork1 = 0, j = 0, ij = 0, ji = 0, rw = 0;
     int hermitien = 0;
+    mat_vps_struct** work = (mat_vps_struct**) block->work;
     mat_vps_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -63,12 +69,12 @@ SCICOS_BLOCKS_IMPEXP void matz_vps(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
+        if ((*work = (mat_vps_struct*) scicos_malloc(sizeof(mat_vps_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (2 * nu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -137,7 +143,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vps(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->rwork1) != NULL)
         {
             scicos_free(ptr->LA);
@@ -154,7 +160,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vps(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             ptr->LA[2 * i] = ur[i];
index be19019..f5bd608 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(zgeev)();
-extern int C2F(zheev)();
-extern int C2F(dlaset)();
+extern int C2F(zgeev)(char *jobvl, char *jobvr, int *n,
+                      double *a, int *lda, double *w, double *vl,
+                      int *ldvl, double *vr, int *ldvr, double *work,
+                      int *lwork, double *rwork, int *info);
+extern int C2F(zheev)(char *jobz, char *uplo, int *n, double
+                      *a, int *lda, double *w, double *work, int *lwork,
+                      double *rwork, int *info);
+extern int C2F(dlaset)(char *uplo, int *m, int *n, double *
+                       alpha, double *beta, double *a, int *lda);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -52,6 +58,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vpv(scicos_block *block, int flag)
     int i = 0, lwork = 0, lwork1 = 0, j = 0, ii = 0, ij = 0, ji = 0, rw = 0;
     int hermitien = 0;
     double l0 = 0.;
+    mat_vpv_struct** work = (mat_vpv_struct**) block->work;
     mat_vpv_struct *ptr = NULL;
 
     nu = GetInPortRows(block, 1);
@@ -68,12 +75,12 @@ SCICOS_BLOCKS_IMPEXP void matz_vpv(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (mat_vpv_struct*) scicos_malloc(sizeof(mat_vpv_struct))) == NULL)
+        if ((*work = (mat_vpv_struct*) scicos_malloc(sizeof(mat_vpv_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LA = (double*) scicos_malloc(sizeof(double) * (2 * nu * nu))) == NULL)
         {
             set_block_error(-16);
@@ -142,7 +149,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vpv(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->rwork1) != NULL)
         {
             scicos_free(ptr->LA);
@@ -159,7 +166,7 @@ SCICOS_BLOCKS_IMPEXP void matz_vpv(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         for (i = 0; i < (nu * nu); i++)
         {
             ptr->LA[2 * i] = ur[i];
index 00ed4c9..99132d8 100644 (file)
@@ -23,7 +23,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(wmmul)();
+extern int C2F(wmmul)(double* Ar, double* Ai, int* na, double* Br, double* Bi, int* nb, double* Cr, double* Ci, int* nc, int* l, int* m, int* n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void matzmul_m(scicos_block *block, int flag)
 {
index 4cce62a..a0715a8 100644 (file)
@@ -23,7 +23,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(mtran)();
+extern int C2F(mtran)(double* a, int* na, double* b, int* nb, int* m, int* n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void matztran_m(scicos_block *block, int flag)
 {
index 8108f47..1168862 100644 (file)
@@ -32,15 +32,17 @@ SCICOS_BLOCKS_IMPEXP void ratelimiter(scicos_block *block, int flag)
     double* pw = NULL;
     double rate = 0. , t = 0.;
 
+    double** work = (double**) block->work;
+
     if (flag == 4)
     {
         /* the workspace is used to store previous values */
-        if ((*block->work = scicos_malloc(sizeof(double) * 4)) == NULL )
+        if ((*work = (double*) scicos_malloc(sizeof(double) * 4)) == NULL )
         {
             set_block_error(-16);
             return;
         }
-        pw = *block->work;
+        pw = *work;
         pw[0] = 0.0;
         pw[1] = 0.0;
         pw[2] = 0.0;
@@ -48,7 +50,7 @@ SCICOS_BLOCKS_IMPEXP void ratelimiter(scicos_block *block, int flag)
     }
     else  if (flag == 5)
     {
-        scicos_free(*block->work);
+        scicos_free(*work);
     }
     else if (flag == 1)
     {
@@ -56,7 +58,7 @@ SCICOS_BLOCKS_IMPEXP void ratelimiter(scicos_block *block, int flag)
         {
             do_cold_restart();
         }
-        pw = *block->work;
+        pw = *work;
         t = get_scicos_time();
         if (t > pw[2])
         {
index 175b141..009e022 100644 (file)
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(riccsl)();
-extern int C2F(riccms)();
-extern int C2F(ricdsl)();
-extern int C2F(ricdmf)();
+extern int C2F(riccsl)(char* TRANA, int* N, double* A, int* LDA, char* UPLO, double* C, int* LDC, double* D, int* LDD, double* X, int* LDX, double* WR, double* WI, double* RCOND, double* FERR, double* WORK, int* LWORK, int* IWORK, int* BWORK, int* INFO);
+extern int C2F(riccms)(char* TRANA, int* N, double* A, int* LDA, char* UPLO, double* C, int* LDC, double* D, int* LDD, double* X, int* LDX, double* WR, double* WI, double* RCOND, double* FERR, double* WORK, int* LWORK, int* IWORK, int* INFO);
+extern int C2F(ricdsl)(char* TRANA, int* N, double* A, int* LDA, char* UPLO, double* C, int* LDC, double* D, int* LDD, double* X, int* LDX, double* WR, double* WI, double* RCOND, double* FERR, double* WORK, int* LWORK, int* IWORK, int* BWORK, int* INFO);
+extern int C2F(ricdmf)(char* TRANA, int* N, double* A, int* LDA, char* UPLO, double* C, int* LDC, double* D, int* LDD, double* X, int* LDX, double* WR, double* WI, double* RCOND, double* FERR, double* WORK, int* LWORK, int* IWORK, int* INFO);
 /*--------------------------------------------------------------------------*/
 typedef struct
 {
@@ -55,6 +55,7 @@ SCICOS_BLOCKS_IMPEXP void ricc_m(scicos_block *block, int flag)
     int nu = 0;
     int info = 0, i = 0;
     int lw = 0;
+    ricc_struct** work = (ricc_struct**) block->work;
     ricc_struct *ptr = NULL;
 
     nu = GetInPortCols(block, 1);
@@ -90,12 +91,12 @@ SCICOS_BLOCKS_IMPEXP void ricc_m(scicos_block *block, int flag)
     /*init : initialization*/
     if (flag == 4)
     {
-        if ((*(block->work) = (ricc_struct*) scicos_malloc(sizeof(ricc_struct))) == NULL)
+        if ((*work = (ricc_struct*) scicos_malloc(sizeof(ricc_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->bwork = (int*) scicos_malloc(sizeof(int) * 2 * nu)) == NULL)
         {
             set_block_error(-16);
@@ -177,7 +178,7 @@ SCICOS_BLOCKS_IMPEXP void ricc_m(scicos_block *block, int flag)
     /* Terminaison */
     else if (flag == 5)
     {
-        ptr = *(block->work);
+        ptr = *work;
         if ((ptr->LX) != NULL)
         {
             scicos_free(ptr->bwork);
@@ -195,7 +196,7 @@ SCICOS_BLOCKS_IMPEXP void ricc_m(scicos_block *block, int flag)
 
     else
     {
-        ptr = *(block->work);
+        ptr = *work;
         if (ipar[0] == 1)
         {
             if (ipar[1] == 1)
index 8e2945f..5660c29 100644 (file)
@@ -24,7 +24,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern double C2F(urand)();
+extern double C2F(urand)(int* iy);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void rndblk_m(scicos_block *block, int flag)
 {
index bb4ac15..def1f47 100644 (file)
@@ -25,7 +25,7 @@
 #include "MALLOC.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern double C2F(urand)();
+extern double C2F(urand)(int* iy);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void rndblkz_m(scicos_block *block, int flag)
 {
index bb2e093..dbb88ed 100644 (file)
@@ -23,7 +23,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dprxc)();
+extern int C2F(dprxc)(int* n, double* roots, double* coeff);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void root_coef(scicos_block *block, int flag)
 {
index 508764a..1677e14 100644 (file)
@@ -23,7 +23,7 @@
 #include "scicos_block4.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(wprxc)();
+extern int C2F(wprxc)(int* n, double* rootr, double* rooti, double* coeffr, double* coeffi);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void rootz_coef(scicos_block *block, int flag)
 {
index 465d138..2f4b155 100644 (file)
@@ -30,7 +30,7 @@ SCICOS_BLOCKS_IMPEXP void samphold4_m(scicos_block *block, int flag)
     Scicos block simulator
     returns sample and hold  of the input */
 
-    if ((flag == 1))
+    if (flag == 1)
     {
         int m = GetInPortRows(block, 1);
         int n = GetInPortCols(block, 1);
index d387b69..435ac67 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i16s(scicos_block *block, int flag)
         short *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         short *u = NULL;
 
         y = Getint16OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 16) / 2;
 
index edbbbb8..6bb726f 100644 (file)
@@ -37,14 +37,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i32e(scicos_block *block, int flag)
         SCSINT32_COP *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         SCSINT32_COP *u = NULL;
 
         y = Getint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 32) / 2;
 
index edf3fe2..b4d1c60 100644 (file)
@@ -33,14 +33,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i32n(scicos_block *block, int flag)
         int nu = 0, mu = 0, nin = 0;
         SCSINT32_COP *y = NULL;
         int *ipar = NULL;
-        double *rpar = NULL;
         SCSINT32_COP *u = NULL;
 
         y = Getint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
 
         if (nin == 1)
index adf514f..31303cd 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i32s(scicos_block *block, int flag)
         SCSINT32_COP *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         SCSINT32_COP *u = NULL;
 
         y = Getint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 32) / 2;
 
index 61d0c65..f376bc2 100644 (file)
@@ -37,14 +37,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i8e(scicos_block *block, int flag)
         char *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         char *u = NULL;
 
         y = Getint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 8) / 2;
         if (nin == 1)
index f9e083b..f360c8f 100644 (file)
@@ -33,14 +33,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i8n(scicos_block *block, int flag)
         int nu = 0, mu = 0, nin = 0;
         char *y = NULL;
         int *ipar = NULL;
-        double *rpar = NULL;
         char *u = NULL;
 
         y = Getint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
 
         if (nin == 1)
index a49cc38..06653f1 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_i8s(scicos_block *block, int flag)
         char *y = NULL;
         int *ipar = NULL;
         double v = 0. , l = 0.;
-        double *rpar = NULL;
         char *u = NULL;
 
         y = Getint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 8) / 2;
         if (nin == 1)
index a156e51..1398f67 100644 (file)
@@ -37,14 +37,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui16e(scicos_block *block, int flag)
         unsigned short *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         unsigned short *u = NULL;
 
         y = Getuint16OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 16);
 
index 0b81130..b73f553 100644 (file)
@@ -33,14 +33,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui16n(scicos_block *block, int flag)
         int nu = 0, mu = 0, nin = 0;
         unsigned short *y = NULL;
         int *ipar = NULL;
-        double *rpar = NULL;
         unsigned short *u = NULL;
 
         y = Getuint16OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
 
         if (nin == 1)
index 8f05a3a..a9ba82f 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui16s(scicos_block *block, int flag)
         unsigned short *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         unsigned short *u = NULL;
 
         y = Getuint16OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 16);
 
index 44ae41f..0c1b6be 100644 (file)
@@ -37,14 +37,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui32e(scicos_block *block, int flag)
         SCSUINT32_COP *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         SCSUINT32_COP *u = NULL;
 
         y = Getuint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 32);
 
index 637132b..102e31b 100644 (file)
@@ -33,14 +33,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui32n(scicos_block *block, int flag)
         int nu = 0, mu = 0, nin = 0;
         SCSUINT32_COP *y = NULL;
         int *ipar = NULL;
-        double *rpar = NULL;
         SCSUINT32_COP *u = NULL;
 
         y = Getuint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
 
         if (nin == 1)
index 606ed88..530cc67 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui32s(scicos_block *block, int flag)
         SCSUINT32_COP *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         SCSUINT32_COP *u = NULL;
 
         y = Getuint32OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 32);
 
index c15f795..e43f87f 100644 (file)
@@ -37,14 +37,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui8e(scicos_block *block, int flag)
         unsigned char *y = NULL;
         int *ipar = NULL;
         double v = 0. , l = 0.;
-        double *rpar = NULL;
         unsigned char *u = NULL;
 
         y = Getuint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 8);
 
index 1b5aa33..8176b81 100644 (file)
@@ -33,14 +33,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui8n(scicos_block *block, int flag)
         int nu = 0, mu = 0, nin = 0;
         unsigned char *y = NULL;
         int *ipar = NULL;
-        double *rpar = NULL;
         unsigned char *u = NULL;
 
         y = Getuint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
 
         if (nin == 1)
index 7baa909..0c4f2d9 100644 (file)
@@ -34,14 +34,12 @@ SCICOS_BLOCKS_IMPEXP void summation_ui8s(scicos_block *block, int flag)
         unsigned char *y = NULL;
         int *ipar = NULL;
         double v = 0., l = 0.;
-        double *rpar = NULL;
         unsigned char *u = NULL;
 
         y = Getuint8OutPortPtrs(block, 1);
         nu = GetInPortRows(block, 1);
         mu = GetInPortCols(block, 1);
         ipar = GetIparPtrs(block);
-        rpar = GetRparPtrs(block);
         nin = GetNin(block);
         l = pow(2, 8);
 
index d83a503..c6f9255 100644 (file)
 #include "scicos_block.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dmmul)();
-extern int C2F(dmmul1)();
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
+extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__,
+                       int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void tcslti4(scicos_block *block, int flag)
 {
index 7f94817..4d729e6 100644 (file)
 #include "scicos_block.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(dmmul)();
-extern int C2F(dmmul1)();
+extern int C2F(dmmul)(double *a, int *na, double *b, int *nb, double *c__,
+                      int *nc, int *l, int *m, int *n);
+extern int C2F(dmmul1)(double *a, int *na, double *b, int *nb, double *c__,
+                       int *nc, int *l, int *m, int *n);
 /*--------------------------------------------------------------------------*/
 SCICOS_BLOCKS_IMPEXP void tcsltj4(scicos_block *block, int flag)
 {
index 7648ae8..b8896b3 100644 (file)
@@ -31,6 +31,7 @@
 SCICOS_BLOCKS_IMPEXP void time_delay(scicos_block *block, int flag)
 {
     /*  rpar[0]=delay, rpar[1]=init value, ipar[0]=buffer length */
+    double** work = (double**) block->work;
     double *pw = NULL, del = 0., t = 0., td = 0., eps = 0.;
     int* iw = NULL;
     int i = 0, j = 0, k = 0;
@@ -38,15 +39,14 @@ SCICOS_BLOCKS_IMPEXP void time_delay(scicos_block *block, int flag)
     if (flag == 4)
     {
         /* the workspace is used to store previous values */
-        if ((*block->work =
-                    scicos_malloc(sizeof(int) + sizeof(double) *
-                                  block->ipar[0] * (1 + block->insz[0]))) == NULL )
+        if ((*work = (double*) scicos_malloc(sizeof(int) + sizeof(double) *
+                                             block->ipar[0] * (1 + block->insz[0]))) == NULL )
         {
             set_block_error(-16);
             return;
         }
         eps = 1.0e-9; /* shift times to left to avoid replacing 0 */
-        pw = *block->work;
+        pw = *work;
         pw[0] = -block->rpar[0] * (block->ipar[0] - 1) - eps;
         for (j = 1; j < block->insz[0] + 1; j++)
         {
@@ -71,7 +71,7 @@ SCICOS_BLOCKS_IMPEXP void time_delay(scicos_block *block, int flag)
     }
     else  if (flag == 5)
     {
-        scicos_free(*block->work);
+        scicos_free(*work);
 
     }
     else if (flag == 0 || flag == 2)
@@ -80,7 +80,7 @@ SCICOS_BLOCKS_IMPEXP void time_delay(scicos_block *block, int flag)
         {
             do_cold_restart();
         }
-        pw = *block->work;
+        pw = *work;
         iw = (int *)(pw + block->ipar[0] * (1 + block->insz[0]));
         t = get_scicos_time();
         td = t - block->rpar[0];
@@ -115,7 +115,7 @@ SCICOS_BLOCKS_IMPEXP void time_delay(scicos_block *block, int flag)
     }
     else if (flag == 1)
     {
-        pw = *block->work;
+        pw = *work;
         iw = (int *) (pw + block->ipar[0] * (1 + block->insz[0]));
         t = get_scicos_time();
         td = t - block->rpar[0];
index b2005ef..9fe357d 100644 (file)
@@ -41,7 +41,7 @@
 #include "localization.h"
 #include "dynlib_scicos_blocks.h"
 /*--------------------------------------------------------------------------*/
-extern int C2F(namstr)();
+extern int C2F(namstr)(int* id, int* i, int* j, int* k);
 /*--------------------------------------------------------------------------*/
 /*YAPASDETROUDANSLESLISTESDANSLESFICHERS*/
 /*ONLITPASPTR_I[8-9-10-11]*/
@@ -112,6 +112,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
     SCSUINT32_COP *u_ul, *ptr_ul, *sav_ul;
     double sav_t;
     /* the struct ptr of that block */
+    towork_struct** work = (towork_struct**) block->work;
     towork_struct *ptr;
     /* */
     int nu, nu2, ut;
@@ -154,13 +155,13 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
     {
         /* init */
         /* begin campaign of allocations */
-        if ((*(block->work) = (towork_struct*) scicos_malloc(sizeof(towork_struct))) == NULL)
+        if ((*work = (towork_struct*) scicos_malloc(sizeof(towork_struct))) == NULL)
         {
             set_block_error(-16);
             return;
         }
 
-        ptr = *(block->work);
+        ptr = *work;
 
         /*
         * t
@@ -170,7 +171,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
         {
             set_block_error(-16);
             scicos_free(ptr);
-            *(block->work) = NULL;
+            *work = NULL;
             return;
         }
         ptr_i    = (int*) ptr->workt;
@@ -218,7 +219,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -238,7 +239,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -272,7 +273,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -292,7 +293,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -326,7 +327,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -346,7 +347,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -379,7 +380,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -398,7 +399,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -431,7 +432,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -450,7 +451,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -483,7 +484,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -502,7 +503,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i       = (int*) ptr->work;
@@ -535,7 +536,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -554,7 +555,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i = (int*) ptr->work;
@@ -587,7 +588,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i      = (int*) ptr->work;
@@ -606,7 +607,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                         set_block_error(-16);
                         scicos_free(ptr->workt);
                         scicos_free(ptr);
-                        *(block->work) = NULL;
+                        *work = NULL;
                         return;
                     }
                     ptr_i = (int*) ptr->work;
@@ -652,7 +653,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
     {
         /* finish */
 
-        ptr = *(block->work);
+        ptr = *work;
 
         if (ptr != NULL)
         {
@@ -833,7 +834,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int*) ptr->work;
@@ -887,7 +888,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -951,7 +952,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1005,7 +1006,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1059,7 +1060,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1113,7 +1114,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1167,7 +1168,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1221,7 +1222,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             set_block_error(-16);
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         ptr_i = (int *) ptr->work;
@@ -1276,12 +1277,12 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
 
             /* write x */
             ptr_i = (int*) ptr->work;
-            if ((varName = scicos_malloc((varNameLen + 6) * sizeof(char))) == NULL)
+            if ((varName = (char*) scicos_malloc((varNameLen + 6) * sizeof(char))) == NULL)
             {
                 set_block_error(-16);
                 scicos_free(ptr->workt);
                 scicos_free(ptr);
-                *(block->work) = NULL;
+                *work = NULL;
                 return;
             }
             memset(varName, 0x0, (varNameLen + 6) * sizeof(char));
@@ -1316,7 +1317,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         memcpy(MatDouble, ptr_d, nRows * nCols * nCols2 * sizeof(double));
@@ -1327,7 +1328,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1342,7 +1343,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         memcpy(MatComplexReal, ptr_d, nRows * nCols * nCols2 * sizeof(double));
@@ -1354,7 +1355,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1369,7 +1370,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1384,7 +1385,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatInt8);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1398,7 +1399,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1413,7 +1414,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatInt16);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1427,7 +1428,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1442,7 +1443,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatInt32);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1456,7 +1457,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1471,7 +1472,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatUInt8);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1485,7 +1486,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1500,7 +1501,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatUInt16);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1514,7 +1515,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr->workt);
                             scicos_free(ptr);
                             scicos_free(varName);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             return;
                         }
                         for (i = 0; i <  nRows * nCols * nCols2; ++i)
@@ -1529,7 +1530,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                             scicos_free(ptr);
                             scicos_free(varName);
                             scicos_free(MatUInt32);
-                            *(block->work) = NULL;
+                            *work = NULL;
                             printError(&sciErr, 0);
                             return;
                         }
@@ -1555,7 +1556,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                     scicos_free(ptr);
                     scicos_free(varName);
                     scicos_free(Time);
-                    *(block->work) = NULL;
+                    *work = NULL;
                     return;
                 }
                 memcpy(Time, ptr_d, nRows * sizeof(double));
@@ -1567,7 +1568,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
                     scicos_free(ptr);
                     scicos_free(varName);
                     scicos_free(Time);
-                    *(block->work) = NULL;
+                    *work = NULL;
                     printError(&sciErr, 0);
                     return;
                 }
@@ -1586,7 +1587,7 @@ SCICOS_BLOCKS_IMPEXP void tows_c(scicos_block *block, int flag)
     else if ((flag == 2) || (flag == 0))
     {
         /* update state */
-        ptr = *(block->work);
+        ptr = *work;
 
         ptr_i = (int*) ptr->work;
 
index 76117f7..20b78f4 100644 (file)
 SCICOS_BLOCKS_IMPEXP void variable_delay(scicos_block *block, int flag)
 {
     /*  rpar[0]=max delay, rpar[1]=init value, ipar[0]=buffer length */
+    double** work = (double**) block->work;
     double* pw = NULL, del = 0., t = 0., td = 0.;
     int* iw = NULL;
     int i = 0, j = 0, k = 0;
     if (flag == 4) /* the workspace is used to store previous values */
     {
-        if ((*block->work =
-                    scicos_malloc(sizeof(int) + sizeof(double) *
-                                  block->ipar[0] * (1 + block->insz[0]))) == NULL )
+        if ((*work = (double*)
+                     scicos_malloc(sizeof(int) + sizeof(double) *
+                                   block->ipar[0] * (1 + block->insz[0]))) == NULL )
         {
             set_block_error(-16);
             return;
         }
-        pw = *block->work;
+        pw = *work;
         pw[0] = -block->rpar[0] * block->ipar[0];
         for (i = 1; i < block->ipar[0]; i++)
         {
@@ -60,7 +61,7 @@ SCICOS_BLOCKS_IMPEXP void variable_delay(scicos_block *block, int flag)
     }
     else  if (flag == 5)
     {
-        scicos_free(*block->work);
+        scicos_free(*work);
     }
     else if (flag == 1)
     {
@@ -68,7 +69,7 @@ SCICOS_BLOCKS_IMPEXP void variable_delay(scicos_block *block, int flag)
         {
             do_cold_restart();
         }
-        pw = *block->work;
+        pw = *work;
         iw = (int *) (pw + block->ipar[0] * (1 + block->insz[0]));
         t = get_scicos_time();
         del = Min(Max(0, block->inptr[1][0]), block->rpar[0]);