Changeset 65
- Timestamp:
- 12/18/06 16:39:34 (2 years ago)
- Files:
-
- trunk/infrastructure/python/2.4/python.d (modified) (3 diffs)
- trunk/infrastructure/python/2.5/python.d (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/infrastructure/python/2.4/python.d
r54 r65 1111 1111 // Will the D layout for a 1-char array be the same as the C layout? I 1112 1112 // think the D array will be larger. 1113 char ob_sval[1]; 1113 char _ob_sval[1]; 1114 char* ob_sval() { 1115 return _ob_sval.ptr; 1116 } 1114 1117 } 1115 1118 … … 1132 1135 int PyString_Size(PyObject *); 1133 1136 char * PyString_AsString(PyObject *); 1137 /* Use only if you know it's a string */ 1138 int PyString_CHECK_INTERNED(PyObject* op) { 1139 return (cast(PyStringObject*)op).ob_sstate; 1140 } 1141 /* Macro, trading safety for speed */ 1142 char* PyString_AS_STRING(PyObject* op) { 1143 return (cast(PyStringObject*)op).ob_sval; 1144 } 1145 int PyString_GET_SIZE(PyObject* op) { 1146 return (cast(PyStringObject*)op).ob_size; 1147 } 1134 1148 PyObject * PyString_Repr(PyObject *, int); 1135 1149 void PyString_Concat(PyObject **, PyObject *); … … 2288 2302 int f_nfreevars; 2289 2303 int f_stacksize; 2290 PyObject *f_localsplus[1]; 2304 PyObject *_f_localsplus[1]; 2305 PyObject** f_localsplus() { 2306 return _f_localsplus.ptr; 2307 } 2291 2308 } 2292 2309 trunk/infrastructure/python/2.5/python.d
r54 r65 1153 1153 // Will the D layout for a 1-char array be the same as the C layout? I 1154 1154 // think the D array will be larger. 1155 // KGM:XXX:1156 // Almost added PyString_AS_STRING and friends, but realized this would1157 // probably cause problems.1158 char ob_sval[1];1155 char _ob_sval[1]; 1156 char* ob_sval() { 1157 return _ob_sval.ptr; 1158 } 1159 1159 } 1160 1160 … … 1177 1177 Py_ssize_t PyString_Size(PyObject *); 1178 1178 char * PyString_AsString(PyObject *); 1179 /* Use only if you know it's a string */ 1180 int PyString_CHECK_INTERNED(PyObject* op) { 1181 return (cast(PyStringObject*)op).ob_sstate; 1182 } 1183 /* Macro, trading safety for speed */ 1184 char* PyString_AS_STRING(PyObject* op) { 1185 return (cast(PyStringObject*)op).ob_sval; 1186 } 1187 Py_ssize_t PyString_GET_SIZE(PyObject* op) { 1188 return (cast(PyStringObject*)op).ob_size; 1189 } 1179 1190 PyObject * PyString_Repr(PyObject *, int); 1180 1191 void PyString_Concat(PyObject **, PyObject *); … … 2505 2516 int f_iblock; 2506 2517 PyTryBlock f_blockstack[CO_MAXBLOCKS]; 2507 PyObject *f_localsplus[1]; 2518 PyObject *_f_localsplus[1]; 2519 PyObject** f_localsplus() { 2520 return _f_localsplus.ptr; 2521 } 2508 2522 } 2509 2523
