diff options
author | joye <joye> | 2015-06-24 21:04:55 (GMT) |
---|---|---|
committer | joye <joye> | 2015-06-24 21:04:55 (GMT) |
commit | 1532d0ed55d2c814c83bb5798eeb34cc25869304 (patch) | |
tree | 0aafca012f06dcd017d768b585fd026da983d81c /src/bltVecCmd.C | |
parent | 821e38f363b36d8ce19b6af6f5940db4f2adbadd (diff) | |
download | blt-1532d0ed55d2c814c83bb5798eeb34cc25869304.zip blt-1532d0ed55d2c814c83bb5798eeb34cc25869304.tar.gz blt-1532d0ed55d2c814c83bb5798eeb34cc25869304.tar.bz2 |
*** empty log message ***
Diffstat (limited to 'src/bltVecCmd.C')
-rw-r--r-- | src/bltVecCmd.C | 37 |
1 files changed, 14 insertions, 23 deletions
diff --git a/src/bltVecCmd.C b/src/bltVecCmd.C index c81425a..b5a07ef 100644 --- a/src/bltVecCmd.C +++ b/src/bltVecCmd.C @@ -206,47 +206,38 @@ static int ObjToIndex(ClientData clientData, Tcl_Interp* interp, static Tcl_Obj* GetValues(Vector *vPtr, int first, int last) { - Tcl_Obj *listObjPtr; - double *vp, *vend; - - listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL); - for (vp = vPtr->valueArr + first, vend = vPtr->valueArr + last; vp <= vend; - vp++) { - Tcl_ListObjAppendElement(vPtr->interp, listObjPtr, - Tcl_NewDoubleObj(*vp)); - } + Tcl_Obj *listObjPtr = Tcl_NewListObj(0, (Tcl_Obj **)NULL); + for (double *vp=vPtr->valueArr+first, *vend=vPtr->valueArr+last; + vp <= vend; vp++) + Tcl_ListObjAppendElement(vPtr->interp, listObjPtr, Tcl_NewDoubleObj(*vp)); return listObjPtr; } static void ReplicateValue(Vector *vPtr, int first, int last, double value) { - double *vp, *vend; - - for (vp = vPtr->valueArr + first, vend = vPtr->valueArr + last; - vp <= vend; vp++) { + for (double *vp=vPtr->valueArr+first, *vend=vPtr->valueArr+last; + vp <= vend; vp++) *vp = value; - } + vPtr->notifyFlags |= UPDATE_RANGE; } static int CopyList(Vector *vPtr, Tcl_Interp* interp, int objc, Tcl_Obj* const objv[]) { - int i; - - if (Vec_SetLength(interp, vPtr, objc) != TCL_OK) { + if (Vec_SetLength(interp, vPtr, objc) != TCL_OK) return TCL_ERROR; - } - for (i = 0; i < objc; i++) { - double value; - if (Blt_ExprDoubleFromObj(interp, objv[i], &value) != TCL_OK) { - Vec_SetLength(interp, vPtr, i); + for (int ii = 0; ii < objc; ii++) { + double value; + if (Blt_ExprDoubleFromObj(interp, objv[ii], &value) != TCL_OK) { + Vec_SetLength(interp, vPtr, ii); return TCL_ERROR; } - vPtr->valueArr[i] = value; + vPtr->valueArr[ii] = value; } + return TCL_OK; } |