[Tclresource-commits] Source tclResourceOSX.c,1.11,1.12
Status: Beta
Brought to you by:
bdesgraupes
From: Bernard D. <bde...@us...> - 2004-09-04 18:12:56
|
Update of /cvsroot/tclresource/Source In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22836/Source Modified Files: tclResourceOSX.c Log Message: Using Tcl_GetLongFromObj Index: tclResourceOSX.c =================================================================== RCS file: /cvsroot/tclresource/Source/tclResourceOSX.c,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- tclResourceOSX.c 4 Sep 2004 16:47:21 -0000 1.11 +++ tclResourceOSX.c 4 Sep 2004 18:12:47 -0000 1.12 @@ -338,7 +338,8 @@ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { int index, result, gotInt, gotValue, length, newValue; - short rsrcId; + short rsrcId; + long theLong; short saveRef, theAttrs; char *resourceId = NULL; char buffer[16]; @@ -423,10 +424,11 @@ switch (index) { case RESOURCE_ATTRIBUTES_ID: - if (Tcl_GetIntFromObj(interp, objv[4], &rsrcId) + if (Tcl_GetLongFromObj(interp, objv[4], &theLong) != TCL_OK) { return TCL_ERROR; } + rsrcId = (short) theLong; gotInt = true; break; case RESOURCE_ATTRIBUTES_NAME: @@ -637,6 +639,7 @@ int i, limitSearch, length; short saveRef, resInfo; short fileRef, rsrcId; + long theLong; char *resourceId = NULL; OpenResourceFork *resourceRef; Handle resource = NULL; @@ -670,10 +673,11 @@ switch (index) { case RESOURCE_DELETE_ID: - if (Tcl_GetIntFromObj(interp, objv[i+1], &rsrcId) + if (Tcl_GetLongFromObj(interp, objv[i+1], &theLong) != TCL_OK) { return TCL_ERROR; } + rsrcId = (short) theLong; gotInt = true; break; case RESOURCE_DELETE_NAME: @@ -1185,7 +1189,8 @@ Tcl_Obj *CONST objv[], /* Argument values. */ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { - short rsrcId; + short rsrcId; + long theLong; int length, releaseIt = 0; char *stringPtr; Handle resource = NULL; @@ -1204,7 +1209,7 @@ return TCL_ERROR; } - if (Tcl_GetIntFromObj(interp, objv[3], &rsrcId) + if (Tcl_GetLongFromObj(interp, objv[3], &theLong) != TCL_OK) { Tcl_AppendStringsToObj(resultPtr, "wrong third argument: expected integer", @@ -1212,6 +1217,7 @@ return TCL_ERROR; } + rsrcId = (short) theLong; stringPtr = Tcl_GetStringFromObj(objv[4], &length); resource = Tcl_MacFindResource(interp, rezType, NULL, rsrcId, stringPtr, &releaseIt); @@ -1597,8 +1603,8 @@ Tcl_Obj *CONST objv[], /* Argument values. */ Tcl_Obj *resultPtr) /* Pointer to store the result. */ { - long size; - short rsrcId; + short rsrcId; + long theLong, size; int length, releaseIt = 0; char *stringPtr; char *resourceId = NULL; @@ -1615,10 +1621,12 @@ return TCL_ERROR; } - if (Tcl_GetIntFromObj((Tcl_Interp *) NULL, objv[3], &rsrcId) + if (Tcl_GetLongFromObj((Tcl_Interp *) NULL, objv[3], &theLong) != TCL_OK) { resourceId = Tcl_GetStringFromObj(objv[3], &length); - } + } else { + rsrcId = (short) theLong; + } if (objc == 5) { stringPtr = Tcl_GetStringFromObj(objv[4], &length); @@ -1812,7 +1820,8 @@ { int index, result, gotInt, releaseIt = 0, force; int i, limitSearch, length; - short rsrcId; + short rsrcId; + long theLong; short saveRef; char *stringPtr; char *resourceId = NULL; @@ -1855,10 +1864,11 @@ switch (index) { case RESOURCE_WRITE_ID: - if (Tcl_GetIntFromObj(interp, objv[i+1], &rsrcId) + if (Tcl_GetLongFromObj(interp, objv[i+1], &theLong) != TCL_OK) { return TCL_ERROR; } + rsrcId = (short) theLong; gotInt = true; i += 2; break; |