Changeset 120

Show
Ignore:
Timestamp:
07/09/05 13:10:52 (3 years ago)
Author:
zoeloelip
Message:

Code clean up and compile fixes for VC.net + VC.net project files update

(Based on patch #1234919)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/ChangeLog

    r119 r120  
    44        * Removed atexit code that only produced segfaults and didn't work 
    55          (Patch from Rob Foehl <rwf at loonybin.net>) 
     6        * Code clean up and compile fixes for VC.net + VC.net project files update 
     7          (Based on patch #1234919) 
    68 
    792005-07-07 Bart Vanbrabant <bart.vanbrabant at zoeloelip.be> 
  • eaccelerator/trunk/debug.c

    r113 r120  
    109109 
    110110#ifdef ZEND_WIN32 
    111     OutputDebugString (*buffer); 
     111    OutputDebugString (*output_buf); 
    112112#else 
    113113    fputs (output_buf, stderr); 
  • eaccelerator/trunk/debug.h

    r113 r120  
    5858void ea_debug_init (TSRMLS_D); 
    5959void ea_debug_shutdown (); 
     60void ea_debug_printf (long debug_level, char *format, ...); 
    6061void ea_debug_error (char *format, ...); 
    6162void ea_debug_pad (long debug_level TSRMLS_DC); 
  • eaccelerator/trunk/ea_restore.c

    r116 r120  
    256256    fixup_hash (&from->function_table, 
    257257            (fixup_bucket_t) fixup_op_array TSRMLS_CC); 
    258 } 
    259  
    260 void eaccelerator_fixup (mm_cache_entry * p TSRMLS_DC) 
    261 { 
    262     mm_fc_entry *q; 
    263  
    264     MMCG (mem) = (char *) ((long) p - (long) p->next); 
    265     MMCG (compress) = 1; 
    266     p->next = NULL; 
    267     FIXUP (p->op_array); 
    268     FIXUP (p->f_head); 
    269     FIXUP (p->c_head); 
    270     fixup_op_array (p->op_array TSRMLS_CC); 
    271     q = p->f_head; 
    272     while (q != NULL) { 
    273         FIXUP (q->fc); 
    274         fixup_op_array ((eaccelerator_op_array *) q->fc TSRMLS_CC); 
    275         FIXUP (q->next); 
    276         q = q->next; 
    277     } 
    278     q = p->c_head; 
    279     while (q != NULL) { 
    280         FIXUP (q->fc); 
    281         fixup_class_entry ((eaccelerator_class_entry *) q->fc TSRMLS_CC); 
    282         FIXUP (q->next); 
    283         q = q->next; 
    284     } 
    285258} 
    286259 
     
    469442#endif 
    470443 
    471     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     444    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    472445    ea_debug_printf (EA_DEBUG, "[%d] restore_op_array: %s\n", getpid (), 
    473446            from->function_name ? from->function_name : "(top)"); 
     
    565538                (CG (class_table), (void *) from_scope_lc, from->scope_name_len + 1, 
    566539                 (void **) &to->scope) != SUCCESS) { 
    567             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     540            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    568541            ea_debug_printf (EA_DEBUG, 
    569542                    "[%d]                   can't find '%s' in hash. use MMCG(class_entry).\n", 
     
    571544            to->scope = MMCG (class_entry); 
    572545        } else { 
    573             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     546            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    574547            ea_debug_printf (EA_DEBUG, 
    575548                    "[%d]                   found '%s' in hash\n", 
     
    579552        efree (from_scope_lc); 
    580553    } else { 
    581         ea_debug_pad (EA_DEBUG TSRMLS_C); 
     554        ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    582555        ea_debug_printf (EA_DEBUG, "[%d]                   from is NULL\n", 
    583556                getpid ()); 
     
    586559 
    587560            for (p = MMCG (class_entry)->parent; p; p = p->parent) { 
    588                 ea_debug_pad (EA_DEBUG TSRMLS_C); 
     561                ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    589562                ea_debug_printf (EA_DEBUG, 
    590563                        "[%d]                   checking parent '%s' have '%s'\n", 
     
    593566                        (&p->function_table, fname_lc, fname_len + 1, 
    594567                         (void **) &function) == SUCCESS) { 
    595                     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     568                    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    596569                    ea_debug_printf (EA_DEBUG, 
    597570                            "[%d]                                   '%s' has '%s' of scope '%s'\n", 
     
    606579    } 
    607580 
    608     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     581    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    609582    ea_debug_printf (EA_DEBUG, "[%d]                   %s's scope is '%s'\n", 
    610583            getpid (), 
     
    614587    if (from->type == ZEND_INTERNAL_FUNCTION) { 
    615588        zend_class_entry *ce = MMCG (class_entry); 
    616         ea_debug_pad (EA_DEBUG TSRMLS_C); 
     589        ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    617590        ea_debug_printf (EA_DEBUG, 
    618591                "[%d]                   [internal function from=%08x,to=%08x] ce='%s' [%08x]\n", 
    619592                getpid (), from, to, ce->name, ce); 
    620593        if (ce) { 
    621             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     594            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    622595            ea_debug_printf (EA_DEBUG, 
    623596                    "[%d]                                       ce->parent='%s' [%08x]\n", 
     
    635608                    (void **) &function) == 
    636609                SUCCESS && function->type == ZEND_INTERNAL_FUNCTION) { 
    637             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     610            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    638611            ea_debug_printf (EA_DEBUG, 
    639612                    "[%d]                                       found in function table\n", 
     
    647620             * damaged structure... 
    648621             */ 
    649             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     622            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    650623            ea_debug_printf (EA_DEBUG, 
    651624                    "[%d]                                       can't find\n", 
     
    731704{ 
    732705    zend_class_entry *old; 
    733     zend_function *f
    734     int fname_len
    735     char *fname_lc
     706    zend_function *f = NULL
     707    int fname_len = 0
     708    char *fname_lc = NULL
    736709#ifdef ZEND_ENGINE_2 
    737710    int cname_len; 
     
    741714#endif 
    742715 
    743     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     716    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    744717    ea_debug_printf (EA_DEBUG, "[%d] retore_class_entry: %s\n", getpid (), 
    745718            from->name ? from->name : "(top)"); 
     
    839812#endif 
    840813    } else { 
    841         ea_debug_pad (EA_DEBUG TSRMLS_C); 
     814        ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    842815        ea_debug_printf (EA_DEBUG, "[%d] parent = NULL\n", getpid ()); 
    843816        to->parent = NULL; 
  • eaccelerator/trunk/ea_store.c

    r118 r120  
    549549    zend_op *end; 
    550550 
    551     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     551    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    552552    ea_debug_printf (EA_DEBUG, "[%d] store_op_array: %s [scope=%s]\n", 
    553553                     getpid (), 
     
    637637                to->scope_name_len = q->nKeyLength - 1; 
    638638 
    639                 ea_debug_pad (EA_DEBUG TSRMLS_C); 
     639                ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    640640                ea_debug_printf (EA_DEBUG, 
    641641                                 "[%d]                 find scope '%s' in CG(class_table) save hashkey '%s' [%08x] as to->scope_name\n", 
     
    648648        } 
    649649        if (to->scope_name == NULL) { 
    650             ea_debug_pad (EA_DEBUG TSRMLS_C); 
     650            ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    651651            ea_debug_printf (EA_DEBUG, 
    652652                             "[%d]                 could not find scope '%s' in CG(class_table), saving it to NULL\n", 
     
    798798#endif 
    799799 
    800     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     800    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    801801    ea_debug_printf (EA_DEBUG, "[%d] store_class_entry: %s parent was '%s'\n", 
    802802                     getpid (), from->name ? from->name : "(top)", 
  • eaccelerator/trunk/eaccelerator.c

    r119 r120  
    560560} 
    561561 
     562void eaccelerator_fixup (mm_cache_entry * p TSRMLS_DC) 
     563{ 
     564  mm_fc_entry *q; 
     565 
     566  MMCG (mem) = (char *) ((long) p - (long) p->next); 
     567  MMCG (compress) = 1; 
     568  p->next = NULL; 
     569  FIXUP (p->op_array); 
     570  FIXUP (p->f_head); 
     571  FIXUP (p->c_head); 
     572  fixup_op_array (p->op_array TSRMLS_CC); 
     573  q = p->f_head; 
     574  while (q != NULL) { 
     575    FIXUP (q->fc); 
     576    fixup_op_array ((eaccelerator_op_array *) q->fc TSRMLS_CC); 
     577    FIXUP (q->next); 
     578    q = q->next; 
     579  } 
     580  q = p->c_head; 
     581  while (q != NULL) { 
     582    FIXUP (q->fc); 
     583    fixup_class_entry ((eaccelerator_class_entry *) q->fc TSRMLS_CC); 
     584    FIXUP (q->next); 
     585    q = q->next; 
     586  } 
     587} 
     588 
    562589/******************************************************************************/ 
    563590/* Cache file functions.                                                                                                          */ 
     
    717744  char *x; 
    718745 
    719   ea_debug_pad (EA_DEBUG TSRMLS_C); 
     746  ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    720747  ea_debug_printf (EA_DEBUG, "[%d] eaccelerator_store_int: key='%s'\n",  
    721748          getpid (), key); 
     
    737764  q = NULL; 
    738765  while (c != NULL) { 
    739     ea_debug_pad (EA_DEBUG TSRMLS_C); 
     766    ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    740767    ea_debug_printf (EA_DEBUG,  
    741768            "[%d] eaccelerator_store_int:     class hashkey=", getpid ()); 
     
    767794  q = NULL; 
    768795  while (f != NULL) { 
    769       ea_debug_pad (EA_DEBUG TSRMLS_C); 
     796      ea_debug_pad (EA_DEBUG TSRMLS_CC); 
    770797      ea_debug_printf (EA_DEBUG,  
    771798              "[%d] eaccelerator_store_int:     function hashkey='%s'\n", getpid (), f->arKey); 
     
    12721299    HashTable* orig_function_table; 
    12731300    HashTable* orig_class_table; 
    1274     HashTable* orig_eg_class_table
     1301    HashTable* orig_eg_class_table = NULL
    12751302    HashTable tmp_function_table; 
    12761303    HashTable tmp_class_table; 
     
    19762003#if defined(WITH_EACCELERATOR_SESSIONS) && defined(HAVE_PHP_SESSIONS_SUPPORT) 
    19772004  if (!eaccelerator_session_registered()) { 
    1978       eaccelerator_register_session(); 
     2005    eaccelerator_register_session(); 
    19792006  } 
    19802007#endif 
  • eaccelerator/trunk/win32/eAccelerator.sln

    r74 r120  
    1010Global 
    1111        GlobalSection(SolutionConfiguration) = preSolution 
    12                 Debug = Debug 
     12                Debug PHP4 = Debug PHP4 
    1313                Debug PHP5 = Debug PHP5 
    14                 Release = Release 
     14                Release PHP4 = Release PHP4 
    1515                Release PHP5 = Release PHP5 
    1616        EndGlobalSection 
    1717        GlobalSection(ProjectConfiguration) = postSolution 
    18                 {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug.ActiveCfg = Debug|Win32 
    19                 {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug.Build.0 = Debug|Win32 
     18                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug PHP4.ActiveCfg = Debug|Win32 
     19                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug PHP4.Build.0 = Debug|Win32 
    2020                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug PHP5.ActiveCfg = Debug PHP5|Win32 
    2121                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Debug PHP5.Build.0 = Debug PHP5|Win32 
    22                 {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release.ActiveCfg = Release|Win32 
    23                 {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release.Build.0 = Release|Win32 
     22                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release PHP4.ActiveCfg = Release|Win32 
     23                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release PHP4.Build.0 = Release|Win32 
    2424                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release PHP5.ActiveCfg = Release PHP5|Win32 
    2525                {9CB8051E-B608-430D-B6AA-D763031A94B7}.Release PHP5.Build.0 = Release PHP5|Win32 
    26                 {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug.ActiveCfg = Debug|Win32 
    27                 {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug.Build.0 = Debug|Win32 
     26                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug PHP4.ActiveCfg = Debug|Win32 
     27                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug PHP4.Build.0 = Debug|Win32 
    2828                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug PHP5.ActiveCfg = Debug PHP5|Win32 
    2929                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Debug PHP5.Build.0 = Debug PHP5|Win32 
    30                 {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release.ActiveCfg = Release|Win32 
    31                 {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release.Build.0 = Release|Win32 
     30                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release PHP4.ActiveCfg = Release|Win32 
     31                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release PHP4.Build.0 = Release|Win32 
    3232                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release PHP5.ActiveCfg = Release PHP5|Win32 
    3333                {5FCBC0AF-2EBB-461F-9971-9272472602E7}.Release PHP5.Build.0 = Release PHP5|Win32 
  • eaccelerator/trunk/win32/eAccelerator.vcproj

    r74 r120  
    7979                </Configuration> 
    8080                <Configuration 
    81                         Name="Release|Win32" 
     81                        Name="Release PHP4|Win32" 
    8282                        OutputDirectory=".\Release" 
    8383                        IntermediateDirectory=".\Release" 
     
    145145                </Configuration> 
    146146                <Configuration 
    147                         Name="Debug|Win32" 
     147                        Name="Debug PHP4|Win32" 
    148148                        OutputDirectory=".\Debug" 
    149149                        IntermediateDirectory=".\Debug" 
     
    292292                                RelativePath="..\debug.c"> 
    293293                        </File> 
     294            <File 
     295                RelativePath="..\ea_restore.c"> 
     296            </File> 
     297            <File 
     298                RelativePath="..\ea_store.c"> 
     299            </File> 
    294300                        <File 
    295301                                RelativePath="..\eaccelerator.c"> 
     
    335341                                RelativePath="..\debug.h"> 
    336342                        </File> 
     343            <File 
     344                RelativePath="..\ea_restore.h"> 
     345            </File> 
     346            <File 
     347                RelativePath="..\ea_store.h"> 
     348            </File> 
    337349                        <File 
    338350                                RelativePath="..\eaccelerator.h"> 
  • eaccelerator/trunk/win32/eLoader.vcproj

    r33 r120  
    7979                </Configuration> 
    8080                <Configuration 
    81                         Name="Release|Win32" 
     81                        Name="Release PHP4|Win32" 
    8282                        OutputDirectory=".\Release" 
    8383                        IntermediateDirectory=".\Release" 
     
    211211                </Configuration> 
    212212                <Configuration 
    213                         Name="Debug|Win32" 
     213                        Name="Debug PHP4|Win32" 
    214214                        OutputDirectory=".\Debug" 
    215215                        IntermediateDirectory=".\Debug"