Check-in [6deb0e2500]
Overview
Comment:Updated to get pointers from Tcl using Tcl_GetWideIntFromObj()
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:6deb0e2500e0e48d009bff3e053a285380f73ded
User & Date: rkeene on 2014-06-22 17:31:30
Other Links: manifest | tags
Context
2014-06-22
18:05
Updated to process string through expr(wide()) to format them correctly check-in: fc293f04c4 user: rkeene tags: trunk
17:31
Updated to get pointers from Tcl using Tcl_GetWideIntFromObj() check-in: 6deb0e2500 user: rkeene tags: trunk
2014-06-21
21:44
Updated to use "source" instead of "." to source a file, for really old shells check-in: 8615f936d3 user: rkeene tags: trunk
Changes

Modified tcc4tcl.c from [1d0ef6f107] to [fc9696732b].

45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
...
119
120
121
122
123
124
125
126



127
128
129
130
131
132
133
		ts->s = NULL;
	}

	ckfree((void *) ts);
}

static int Tcc4tclHandleCmd ( ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]){
	unsigned long val;
	void *val_p;
	int index;
	int res;
	struct TclTCCState *ts;
	TCCState *s;
	Tcl_Obj *sym_addr;
	static CONST char *options[] = {
................................................................................
            }
        case TCC4TCL_ADD_SYMBOL:
            if (objc != 4) {
                Tcl_WrongNumArgs(interp, 2, objv, "symbol value");
                return TCL_ERROR;
            }

            Tcl_GetLongFromObj(interp, objv[3], &val);



            val_p = (void *) val;

            tcc_add_symbol(s,Tcl_GetString(objv[2]), val_p); 
            return TCL_OK; 
        case TCC4TCL_COMMAND:
            if (objc != 4) {
                Tcl_WrongNumArgs(interp, 2, objv, "tclname cname");







|







 







|
>
>
>







45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
...
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
		ts->s = NULL;
	}

	ckfree((void *) ts);
}

static int Tcc4tclHandleCmd ( ClientData cdata, Tcl_Interp *interp, int objc, Tcl_Obj * CONST objv[]){
	Tcl_WideInt val;
	void *val_p;
	int index;
	int res;
	struct TclTCCState *ts;
	TCCState *s;
	Tcl_Obj *sym_addr;
	static CONST char *options[] = {
................................................................................
            }
        case TCC4TCL_ADD_SYMBOL:
            if (objc != 4) {
                Tcl_WrongNumArgs(interp, 2, objv, "symbol value");
                return TCL_ERROR;
            }

            if (Tcl_GetWideIntFromObj(interp, objv[3], &val) != TCL_OK) {
                return TCL_ERROR;
            }

            val_p = (void *) val;

            tcc_add_symbol(s,Tcl_GetString(objv[2]), val_p); 
            return TCL_OK; 
        case TCC4TCL_COMMAND:
            if (objc != 4) {
                Tcl_WrongNumArgs(interp, 2, objv, "tclname cname");