Changeset 65

Show
Ignore:
Timestamp:
12/18/06 16:39:34 (2 years ago)
Author:
KirkMcDonald
Message:

Python header fixes

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/infrastructure/python/2.4/python.d

    r54 r65  
    11111111    // Will the D layout for a 1-char array be the same as the C layout?  I 
    11121112    // 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    } 
    11141117  } 
    11151118 
     
    11321135  int PyString_Size(PyObject *); 
    11331136  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  } 
    11341148  PyObject * PyString_Repr(PyObject *, int); 
    11351149  void PyString_Concat(PyObject **, PyObject *); 
     
    22882302    int f_nfreevars; 
    22892303    int f_stacksize; 
    2290     PyObject *f_localsplus[1]; 
     2304    PyObject *_f_localsplus[1]; 
     2305    PyObject** f_localsplus() { 
     2306      return _f_localsplus.ptr; 
     2307    } 
    22912308  } 
    22922309 
  • trunk/infrastructure/python/2.5/python.d

    r54 r65  
    11531153    // Will the D layout for a 1-char array be the same as the C layout?  I 
    11541154    // think the D array will be larger. 
    1155     // KGM:XXX: 
    1156     // Almost added PyString_AS_STRING and friends, but realized this would 
    1157     // probably cause problems. 
    1158     char ob_sval[1]; 
     1155    char _ob_sval[1]; 
     1156    char* ob_sval() { 
     1157        return _ob_sval.ptr; 
     1158    } 
    11591159  } 
    11601160 
     
    11771177  Py_ssize_t PyString_Size(PyObject *); 
    11781178  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  } 
    11791190  PyObject * PyString_Repr(PyObject *, int); 
    11801191  void PyString_Concat(PyObject **, PyObject *); 
     
    25052516    int f_iblock; 
    25062517    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    } 
    25082522  } 
    25092523