Skip to content
This repository has been archived by the owner on Feb 6, 2019. It is now read-only.

Commit

Permalink
fix ts build
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Feb 24, 2014
1 parent 4b738ce commit 85b5907
Show file tree
Hide file tree
Showing 10 changed files with 251 additions and 247 deletions.
1 change: 1 addition & 0 deletions dev/phpdbg_parser.y
Expand Up @@ -22,6 +22,7 @@
ZEND_EXTERN_MODULE_GLOBALS(phpdbg);

int yyerror(phpdbg_param_t *stack, yyscan_t scanner, const char *msg) {
TSRMLS_FETCH();
phpdbg_error("Parse Error: %s", msg);
{
const phpdbg_param_t *top = stack;
Expand Down
2 changes: 1 addition & 1 deletion phpdbg_bp.c
Expand Up @@ -994,7 +994,7 @@ static inline phpdbg_breakbase_t *phpdbg_find_conditional_breakpoint(zend_execut
zend_try {
PHPDBG_G(flags) |= PHPDBG_IN_COND_BP;
zend_execute(EG(active_op_array) TSRMLS_CC);
#if PHP_VERSION_ID >= 50700
#if PHP_VERSION_ID >= 50600
if (zend_is_true(retval TSRMLS_CC)) {
#else
if (zend_is_true(retval)) {
Expand Down
4 changes: 2 additions & 2 deletions phpdbg_cmd.c
Expand Up @@ -738,7 +738,7 @@ PHPDBG_API const phpdbg_command_t* phpdbg_stack_resolve(const phpdbg_command_t *
} /* }}} */

/* {{{ */
PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why) {
PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why TSRMLS_DC) {
phpdbg_param_t *top = NULL;
const phpdbg_command_t *handler = NULL;

Expand Down Expand Up @@ -768,7 +768,7 @@ PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why) {
phpdbg_prompt_commands, NULL, &top, why);

if (handler) {
if (phpdbg_stack_verify(handler, &top, why) == SUCCESS) {
if (phpdbg_stack_verify(handler, &top, why TSRMLS_CC) == SUCCESS) {
return handler->handler(top TSRMLS_CC);
}
}
Expand Down
2 changes: 1 addition & 1 deletion phpdbg_cmd.h
Expand Up @@ -134,7 +134,7 @@ PHPDBG_API void phpdbg_destroy_input(char** TSRMLS_DC);
PHPDBG_API void phpdbg_stack_push(phpdbg_param_t *stack, phpdbg_param_t *param);
PHPDBG_API const phpdbg_command_t* phpdbg_stack_resolve(const phpdbg_command_t *commands, const phpdbg_command_t *parent, phpdbg_param_t **top, char **why);
PHPDBG_API int phpdbg_stack_verify(const phpdbg_command_t *command, phpdbg_param_t **stack, char **why TSRMLS_DC);
PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why);
PHPDBG_API int phpdbg_stack_execute(phpdbg_param_t *stack, char **why TSRMLS_DC);
PHPDBG_API void phpdbg_stack_free(phpdbg_param_t *stack);

/*
Expand Down
64 changes: 33 additions & 31 deletions phpdbg_lexer.c
Expand Up @@ -9,7 +9,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#define YY_FLEX_SUBMINOR_VERSION 37
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
Expand Down Expand Up @@ -54,7 +54,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
Expand Down Expand Up @@ -85,6 +84,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

#ifdef __cplusplus
Expand Down Expand Up @@ -170,6 +171,11 @@ typedef void* yyscan_t;
typedef struct yy_buffer_state *YY_BUFFER_STATE;
#endif

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

#define EOB_ACT_CONTINUE_SCAN 0
#define EOB_ACT_END_OF_FILE 1
#define EOB_ACT_LAST_MATCH 2
Expand All @@ -192,11 +198,6 @@ typedef struct yy_buffer_state *YY_BUFFER_STATE;

#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )

#ifndef YY_TYPEDEF_YY_SIZE_T
#define YY_TYPEDEF_YY_SIZE_T
typedef size_t yy_size_t;
#endif

#ifndef YY_STRUCT_YY_BUFFER_STATE
#define YY_STRUCT_YY_BUFFER_STATE
struct yy_buffer_state
Expand All @@ -214,7 +215,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
yy_size_t yy_n_chars;

/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
Expand Down Expand Up @@ -293,7 +294,7 @@ static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );

YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );

void *yyalloc (yy_size_t ,yyscan_t yyscanner );
void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
Expand Down Expand Up @@ -325,7 +326,7 @@ void yyfree (void * ,yyscan_t yyscanner );

/* Begin user sect3 */

#define yywrap(n) 1
#define yywrap(yyscanner) 1
#define YY_SKIP_YYWRAP

typedef unsigned char YY_CHAR;
Expand Down Expand Up @@ -513,7 +514,7 @@ static yyconst flex_int16_t yy_chk[231] =
#include <string.h>

#define YY_NO_UNISTD_H 1
#line 517 "sapi/phpdbg/phpdbg_lexer.c"
#line 518 "sapi/phpdbg/phpdbg_lexer.c"

#define INITIAL 0
#define RAW 1
Expand Down Expand Up @@ -543,8 +544,8 @@ struct yyguts_t
size_t yy_buffer_stack_max; /**< capacity of stack. */
YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
char yy_hold_char;
int yy_n_chars;
int yyleng_r;
yy_size_t yy_n_chars;
yy_size_t yyleng_r;
char *yy_c_buf_p;
int yy_init;
int yy_start;
Expand Down Expand Up @@ -597,7 +598,7 @@ FILE *yyget_out (yyscan_t yyscanner );

void yyset_out (FILE * out_str ,yyscan_t yyscanner );

int yyget_leng (yyscan_t yyscanner );
yy_size_t yyget_leng (yyscan_t yyscanner );

char *yyget_text (yyscan_t yyscanner );

Expand Down Expand Up @@ -666,7 +667,7 @@ static int input (yyscan_t yyscanner );
if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
{ \
int c = '*'; \
unsigned n; \
size_t n; \
for ( n = 0; n < max_size && \
(c = getc( yyin )) != EOF && c != '\n'; ++n ) \
buf[n] = (char) c; \
Expand Down Expand Up @@ -753,7 +754,7 @@ YY_DECL

#line 42 "sapi/phpdbg/dev/phpdbg_lexer.l"

#line 757 "sapi/phpdbg/phpdbg_lexer.c"
#line 758 "sapi/phpdbg/phpdbg_lexer.c"

yylval = yylval_param;

Expand Down Expand Up @@ -955,7 +956,7 @@ YY_RULE_SETUP
#line 104 "sapi/phpdbg/dev/phpdbg_lexer.l"
YY_FATAL_ERROR( "flex scanner jammed" );
YY_BREAK
#line 959 "sapi/phpdbg/phpdbg_lexer.c"
#line 960 "sapi/phpdbg/phpdbg_lexer.c"
case YY_STATE_EOF(INITIAL):
case YY_STATE_EOF(RAW):
yyterminate();
Expand Down Expand Up @@ -1144,21 +1145,21 @@ static int yy_get_next_buffer (yyscan_t yyscanner)

else
{
int num_to_read =
yy_size_t num_to_read =
YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;

while ( num_to_read <= 0 )
{ /* Not enough room in the buffer - grow it. */

/* just a shorter name for the current buffer */
YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
YY_BUFFER_STATE b = YY_CURRENT_BUFFER_LVALUE;

int yy_c_buf_p_offset =
(int) (yyg->yy_c_buf_p - b->yy_ch_buf);

if ( b->yy_is_our_buffer )
{
int new_size = b->yy_buf_size * 2;
yy_size_t new_size = b->yy_buf_size * 2;

if ( new_size <= 0 )
b->yy_buf_size += b->yy_buf_size / 8;
Expand Down Expand Up @@ -1189,7 +1190,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)

/* Read in more data. */
YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
yyg->yy_n_chars, (size_t) num_to_read );
yyg->yy_n_chars, num_to_read );

YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
}
Expand Down Expand Up @@ -1286,6 +1287,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
yy_is_jam = (yy_current_state == 66);

(void)yyg;
return yy_is_jam ? 0 : yy_current_state;
}

Expand All @@ -1302,7 +1304,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)
if ( yy_cp < YY_CURRENT_BUFFER_LVALUE->yy_ch_buf + 2 )
{ /* need to shift things up to make room */
/* +2 for EOB chars. */
register int number_to_move = yyg->yy_n_chars + 2;
register yy_size_t number_to_move = yyg->yy_n_chars + 2;
register char *dest = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[
YY_CURRENT_BUFFER_LVALUE->yy_buf_size + 2];
register char *source =
Expand Down Expand Up @@ -1352,7 +1354,7 @@ static int yy_get_next_buffer (yyscan_t yyscanner)

else
{ /* need more input */
int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
yy_size_t offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
++yyg->yy_c_buf_p;

switch ( yy_get_next_buffer( yyscanner ) )
Expand Down Expand Up @@ -1632,7 +1634,7 @@ void yypop_buffer_state (yyscan_t yyscanner)
*/
static void yyensure_buffer_stack (yyscan_t yyscanner)
{
int num_to_alloc;
yy_size_t num_to_alloc;
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;

if (!yyg->yy_buffer_stack) {
Expand Down Expand Up @@ -1725,17 +1727,17 @@ YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)

/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
* scan from a @e copy of @a bytes.
* @param bytes the byte buffer to scan
* @param len the number of bytes in the buffer pointed to by @a bytes.
* @param yybytes the byte buffer to scan
* @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
* @param yyscanner The scanner object.
* @return the newly allocated buffer state object.
*/
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
YY_BUFFER_STATE yy_scan_bytes (yyconst char * yybytes, yy_size_t _yybytes_len , yyscan_t yyscanner)
{
YY_BUFFER_STATE b;
char *buf;
yy_size_t n;
int i;
yy_size_t i;

/* Get memory for full buffer, including space for trailing EOB's. */
n = _yybytes_len + 2;
Expand Down Expand Up @@ -1845,7 +1847,7 @@ FILE *yyget_out (yyscan_t yyscanner)
/** Get the length of the current token.
* @param yyscanner The scanner object.
*/
int yyget_leng (yyscan_t yyscanner)
yy_size_t yyget_leng (yyscan_t yyscanner)
{
struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
return yyleng;
Expand Down Expand Up @@ -1881,7 +1883,7 @@ void yyset_lineno (int line_number , yyscan_t yyscanner)

/* lineno is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner);
YY_FATAL_ERROR( "yyset_lineno called with no buffer" );

yylineno = line_number;
}
Expand All @@ -1896,7 +1898,7 @@ void yyset_column (int column_no , yyscan_t yyscanner)

/* column is only valid if an input buffer exists. */
if (! YY_CURRENT_BUFFER )
yy_fatal_error( "yyset_column called with no buffer" , yyscanner);
YY_FATAL_ERROR( "yyset_column called with no buffer" );

yycolumn = column_no;
}
Expand Down
15 changes: 8 additions & 7 deletions phpdbg_lexer.h
Expand Up @@ -13,7 +13,7 @@
#define FLEX_SCANNER
#define YY_FLEX_MAJOR_VERSION 2
#define YY_FLEX_MINOR_VERSION 5
#define YY_FLEX_SUBMINOR_VERSION 35
#define YY_FLEX_SUBMINOR_VERSION 37
#if YY_FLEX_SUBMINOR_VERSION > 0
#define FLEX_BETA
#endif
Expand Down Expand Up @@ -58,7 +58,6 @@ typedef int flex_int32_t;
typedef unsigned char flex_uint8_t;
typedef unsigned short int flex_uint16_t;
typedef unsigned int flex_uint32_t;
#endif /* ! C99 */

/* Limits of integral types. */
#ifndef INT8_MIN
Expand Down Expand Up @@ -89,6 +88,8 @@ typedef unsigned int flex_uint32_t;
#define UINT32_MAX (4294967295U)
#endif

#endif /* ! C99 */

#endif /* ! FLEXINT_H */

#ifdef __cplusplus
Expand Down Expand Up @@ -161,7 +162,7 @@ struct yy_buffer_state
/* Number of characters read into yy_ch_buf, not including EOB
* characters.
*/
int yy_n_chars;
yy_size_t yy_n_chars;

/* Whether we "own" the buffer - i.e., we know we created it,
* and can realloc() it to grow it, and should free() it to
Expand Down Expand Up @@ -205,15 +206,15 @@ void yypop_buffer_state (yyscan_t yyscanner );

YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,yy_size_t len ,yyscan_t yyscanner );

void *yyalloc (yy_size_t ,yyscan_t yyscanner );
void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
void yyfree (void * ,yyscan_t yyscanner );

/* Begin user sect3 */

#define yywrap(n) 1
#define yywrap(yyscanner) 1
#define YY_SKIP_YYWRAP

#define yytext_ptr yytext_r
Expand Down Expand Up @@ -261,7 +262,7 @@ FILE *yyget_out (yyscan_t yyscanner );

void yyset_out (FILE * out_str ,yyscan_t yyscanner );

int yyget_leng (yyscan_t yyscanner );
yy_size_t yyget_leng (yyscan_t yyscanner );

char *yyget_text (yyscan_t yyscanner );

Expand Down Expand Up @@ -341,6 +342,6 @@ extern int yylex \
#line 104 "sapi/phpdbg/dev/phpdbg_lexer.l"


#line 345 "sapi/phpdbg/phpdbg_lexer.h"
#line 346 "sapi/phpdbg/phpdbg_lexer.h"
#undef yyIN_HEADER
#endif /* yyHEADER_H */

0 comments on commit 85b5907

Please sign in to comment.