Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

- Didn't compile on Win32

  • Loading branch information...
commit ee26ec5e9cff3e12c4ba2c203948ac5384b83f98 1 parent 51ef369
@andigutmans andigutmans authored
Showing with 14 additions and 6 deletions.
  1. +8 −0 Zend/ZendTS.dsp
  2. +6 −6 Zend/zend_dynamic_array.c
View
8 Zend/ZendTS.dsp
@@ -139,6 +139,10 @@ SOURCE=.\zend_constants.c
# End Source File
# Begin Source File
+SOURCE=.\zend_dynamic_array.c
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_execute.c
# End Source File
# Begin Source File
@@ -243,6 +247,10 @@ SOURCE=.\zend_constants.h
# End Source File
# Begin Source File
+SOURCE=.\zend_dynamic_array.h
+# End Source File
+# Begin Source File
+
SOURCE=.\zend_errors.h
# End Source File
# Begin Source File
View
12 Zend/zend_dynamic_array.c
@@ -20,7 +20,7 @@
#include "zend.h"
typedef struct _dynamic_array {
- void *array;
+ char *array;
unsigned int element_size;
unsigned int current;
unsigned int allocated;
@@ -31,7 +31,7 @@ ZEND_API int zend_dynamic_array_init(dynamic_array *da, unsigned int element_siz
da->element_size = element_size;
da->allocated = size;
da->current = 0;
- da->array = (void *) emalloc(size*element_size);
+ da->array = (char *) emalloc(size*element_size);
if (da->array == NULL) {
return 1;
}
@@ -42,14 +42,14 @@ ZEND_API void *zend_dynamic_array_push(dynamic_array *da)
{
if (da->current == da->allocated) {
da->allocated *= 2;
- da->array = (void *) erealloc(da->array, da->allocated*da->element_size);
+ da->array = (char *) erealloc(da->array, da->allocated*da->element_size);
}
- return (da->array+(da->current++)*da->element_size);
+ return (void *)(da->array+(da->current++)*da->element_size);
}
ZEND_API void *zend_dynamic_array_pop(dynamic_array *da)
{
- return (da->array+(--(da->current))*da->element_size);
+ return (void *)(da->array+(--(da->current))*da->element_size);
}
@@ -58,5 +58,5 @@ ZEND_API void *zend_dynamic_array_get_element(dynamic_array *da, unsigned int in
if (index >= da->current) {
return NULL;
}
- return (da->array+index*da->element_size);
+ return (void *)(da->array+index*da->element_size);
}
Please sign in to comment.
Something went wrong with that request. Please try again.