- Fix compilation with GCC 4.0-20041219.

svn path=/trunk/; revision=12321
This commit is contained in:
Filip Navara 2004-12-24 23:01:35 +00:00
parent 2c0d95525f
commit 63dde03aef
13 changed files with 72 additions and 75 deletions

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/include/js.h,v $
* $Id: js.h,v 1.1 2004/01/10 20:38:17 arty Exp $
* $Id: js.h,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
#ifndef JS_H
@ -261,7 +261,7 @@ typedef JSMethodResult (*JSConstructor) (JSClassPtr cls, JSInterpPtr interp,
* number. The returned string is in format "MAJOR.MINOR.PATCH",
* where MAJOR, MINOR, and PATCH are integer numbers.
*/
const JSCharPtr JS_DLLEXPORT js_version ();
JSCharPtr JS_DLLEXPORT js_version ();
/* Initialize interpreter options to system's default values. */
void JS_DLLEXPORT js_init_default_options (JSInterpOptions *options);
@ -275,7 +275,7 @@ JSInterpPtr JS_DLLEXPORT js_create_interp (JSInterpOptions *options,
void JS_DLLEXPORT js_destroy_interp (JSInterpPtr interp);
/* Return error message from the latest error. */
const JSCharPtr JS_DLLEXPORT js_error_message (JSInterpPtr interp);
JSCharPtr JS_DLLEXPORT js_error_message (JSInterpPtr interp);
/*
* Get the result of the latest evaluation or execution in interpreter
@ -456,8 +456,8 @@ int JS_DLLEXPORT js_instantiate_class (JSInterpPtr interp, JSClassPtr cls,
void *ictx, JSFreeProc ictx_destructor,
JSType *result_return);
const JSClassPtr JS_DLLEXPORT js_lookup_class (JSInterpPtr interp,
char *name);
JSClassPtr JS_DLLEXPORT js_lookup_class (JSInterpPtr interp,
char *name);
/*
* Check if object <object> is an instance of class <cls>. The

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/ksrc/b_core.c,v $
* $Id: b_core.c,v 1.1 2004/01/10 20:38:17 arty Exp $
* $Id: b_core.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
/*
@ -185,7 +185,7 @@ escape_global_method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
EMIT_TO_RESULT (c);
else if (c > 0xFF)
{
unsigned char buf[6];
char buf[6];
sprintf (buf, "%04x", c);
EMIT_TO_RESULT ('%');
@ -197,7 +197,7 @@ escape_global_method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
}
else
{
unsigned char buf[4];
char buf[4];
sprintf (buf, "%02x", c);
EMIT_TO_RESULT ('%');

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/ksrc/b_regexp.c,v $
* $Id: b_regexp.c,v 1.1 2004/01/10 20:38:17 arty Exp $
* $Id: b_regexp.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
#include "jsint.h"
@ -275,7 +275,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
input_str = &cvt;
}
input = input_str->u.vstring->data;
input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
}
else if (args->u.vinteger == 1)
@ -288,7 +288,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
input_str = &cvt;
}
input = input_str->u.vstring->data;
input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
/* Set the input property to the class context. */
@ -317,7 +317,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
input_str = &cvt;
}
input = input_str->u.vstring->data;
input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
}
else if (args->u.vinteger == 1)
@ -330,7 +330,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
input_str = &cvt;
}
input = input_str->u.vstring->data;
input = (char*)input_str->u.vstring->data;
input_len = input_str->u.vstring->len;
/* Set the input property to the class context. */
@ -370,11 +370,6 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
js_vm_symname (vm, method));
js_vm_error (vm);
/* argument_type_error: */
sprintf (vm->error, "RegExp.%s(): illegal argument",
js_vm_symname (vm, method));
js_vm_error (vm);
immutable:
sprintf (vm->error, "RegExp.%s(): immutable object",
js_vm_symname (vm, method));
@ -406,7 +401,7 @@ global_method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
sprintf (vm->error, "RegExp(): RegExp.input is not a string");
js_vm_error (vm);
}
input = ctx->input.u.vstring->data;
input = (char*)ctx->input.u.vstring->data;
input_len = ctx->input.u.vstring->len;
}
else if (args->u.vinteger == 1)
@ -417,7 +412,7 @@ global_method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
js_vm_error (vm);
}
input = args[1].u.vstring->data;
input = (char*)args[1].u.vstring->data;
input_len = args[1].u.vstring->len;
/* Set the input property to the class context. */
@ -466,7 +461,7 @@ property (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
ctx->input.u.vstring->data
(char*)ctx->input.u.vstring->data
+ ctx->regs.start[index],
ctx->regs.end[index] - ctx->regs.start[index]);
}
@ -542,7 +537,8 @@ property (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
ctx->input.u.vstring->data + ctx->regs.start[0],
(char*)ctx->input.u.vstring->data +
ctx->regs.start[0],
ctx->regs.end[0] - ctx->regs.start[0]);
}
/* ********************************************************************** */
@ -565,7 +561,7 @@ property (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
ctx->input.u.vstring->data
(char*)ctx->input.u.vstring->data
+ ctx->regs.start[i],
ctx->regs.end[i] - ctx->regs.start[i]);
}
@ -580,7 +576,7 @@ property (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
|| ctx->regs.end[0] > ctx->input.u.vstring->len)
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node, ctx->input.u.vstring->data,
js_vm_make_string (vm, node, (char*)ctx->input.u.vstring->data,
ctx->regs.start[0]);
}
/* ********************************************************************** */
@ -598,7 +594,7 @@ property (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
node->type = JS_UNDEFINED;
else
js_vm_make_string (vm, node,
ctx->input.u.vstring->data + ctx->regs.end[0],
(char*)ctx->input.u.vstring->data + ctx->regs.end[0],
ctx->input.u.vstring->len - ctx->regs.end[0]);
}
/* ********************************************************************** */
@ -726,7 +722,7 @@ new_proc (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info, JSNode *args,
js_vm_error (vm);
}
source = args[1].u.vstring->data;
source = (char*)args[1].u.vstring->data;
source_len = args[1].u.vstring->len;
}
@ -769,7 +765,7 @@ delete_proc (JSBuiltinInfo *builtin_info, void *instance_context)
js_free (ictx->source);
if (ictx->compiled.buffer)
js_free (ictx->compiled.buffer);
free (ictx->compiled.buffer);
if (ictx->compiled.fastmap)
js_free (ictx->compiled.fastmap);
@ -1047,9 +1043,9 @@ js_builtin_RegExp_replace (JSVirtualMachine *vm, char *data,
EMIT_TO_RESULT (data + pos, datalen - pos);
if (regs.start)
js_free (regs.start);
free (regs.start);
if (regs.end)
js_free (regs.end);
free (regs.end);
}
@ -1130,7 +1126,7 @@ js_builtin_RegExp_split (JSVirtualMachine *vm, char *data,
}
if (regs.start)
js_free (regs.start);
free (regs.start);
if (regs.end)
js_free (regs.end);
free (regs.end);
}

View file

@ -576,7 +576,7 @@ op_load_array:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@ -697,7 +697,7 @@ op_store_array:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@ -1005,7 +1005,7 @@ op_add:
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();

View file

@ -550,7 +550,7 @@ case 27:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@ -670,7 +670,7 @@ case 28:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@ -967,7 +967,7 @@ case 39:
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();

View file

@ -548,7 +548,7 @@ case 27:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below must be in sync with operand `load_property'. */
@ -668,7 +668,7 @@ case 28:
else if (JS_SP1->type == JS_STRING)
{
/* Intern the string. */
j = js_vm_intern_with_len (vm, JS_SP1->u.vstring->data,
j = js_vm_intern_with_len (vm, (char*)JS_SP1->u.vstring->data,
JS_SP1->u.vstring->len);
/* The code below msut be in sync with operand `store_property'. */
@ -965,7 +965,7 @@ case 39:
memcpy (ndata, d2, d2_len);
memcpy (ndata + d2_len, d1, d1_len);
js_vm_make_static_string (vm, JS_SP2, ndata, nlen);
js_vm_make_static_string (vm, JS_SP2, (char*)ndata, nlen);
JS_SP2->u.vstring->staticp = 0;
JS_POP ();
JS_MAYBE_GC ();

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/ksrc/js.c,v $
* $Id: js.c,v 1.2 2004/05/07 05:12:10 royce Exp $
* $Id: js.c,v 1.3 2004/12/24 23:01:35 navaraf Exp $
*/
#include "js.h"
@ -160,7 +160,7 @@ static JSIOStream *iostream_iofunc (JSIOFunc func, void *context,
* Global functions.
*/
const JSCharPtr
JSCharPtr
js_version ()
{
return VERSION;
@ -278,7 +278,7 @@ js_destroy_interp (JSInterpPtr interp)
}
const JSCharPtr
JSCharPtr
js_error_message (JSInterpPtr interp)
{
return interp->vm->error;
@ -792,7 +792,7 @@ js_instantiate_class (JSInterpPtr interp, JSClassPtr cls, void *ictx,
}
const JSClassPtr
JSClassPtr
js_lookup_class (JSInterpPtr interp, char *name)
{
JSNode *n;
@ -840,7 +840,7 @@ js_type_make_string (JSInterpPtr interp, JSType *type, unsigned char *data,
{
JSNode *n = (JSNode *) type;
js_vm_make_string (interp->vm, n, data, length);
js_vm_make_string (interp->vm, n, (char*)data, length);
}

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/ksrc/object.c,v $
* $Id: object.c,v 1.1 2004/01/10 20:38:17 arty Exp $
* $Id: object.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
#include "ddk/ntddk.h"
@ -431,7 +431,7 @@ js_vm_object_nth (JSVirtualMachine *vm, JSObject *obj, int nth,
abort ();
}
js_vm_make_string (vm, value_return, b->data, b->len);
js_vm_make_string (vm, value_return, (char*)b->data, b->len);
return 1;
}

View file

@ -1564,7 +1564,7 @@ static boolean at_endline_loc_p _RE_ARGS ((const char *p, const char *pend,
reg_syntax_t syntax));
static reg_errcode_t compile_range _RE_ARGS ((const char **p_ptr,
const char *pend,
char *translate,
RE_TRANSLATE_TYPE translate,
reg_syntax_t syntax,
unsigned char *b));
@ -3807,7 +3807,7 @@ static boolean common_op_match_null_string_p _RE_ARGS ((unsigned char **p,
unsigned char *end,
register_info_type *reg_info));
static int bcmp_translate _RE_ARGS ((const char *s1, const char *s2,
int len, char *translate));
int len, RE_TRANSLATE_TYPE translate));
/* re_match_2 matches the compiled pattern in BUFP against the
the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/ksrc/vm.c,v $
* $Id: vm.c,v 1.1 2004/01/10 20:38:17 arty Exp $
* $Id: vm.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
#include "jsint.h"
@ -296,7 +296,7 @@ js_vm_execute (JSVirtualMachine *vm, JSByteCode *bc)
{
int i, sect;
unsigned int ui;
unsigned char *cp;
char *cp;
unsigned int consts_offset;
char buf[256];
JSSymtabEntry *symtab = NULL;

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/src/b_string.c,v $
* $Id: b_string.c,v 1.1 2004/01/10 20:38:18 arty Exp $
* $Id: b_string.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
/* TODO: global method: String (obj) => string */
@ -141,7 +141,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
unsigned int arg = 2;
JSUInt32 ui;
double dval;
unsigned char *buffer = NULL;
char *buffer = NULL;
unsigned int bufpos = 0;
if (args->u.vinteger < 1)
@ -442,8 +442,8 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
|| args[1].u.vbuiltin->info != ctx->regexp_info)
goto argument_type_error;
js_builtin_RegExp_match (vm, n->u.vstring->data, n->u.vstring->len,
&args[1], result_return);
js_builtin_RegExp_match (vm, (char*)n->u.vstring->data,
n->u.vstring->len, &args[1], result_return);
}
/* ***************************************************************** */
else if (method == ctx->s_replace)
@ -456,8 +456,9 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
|| args[2].type != JS_STRING)
goto argument_type_error;
js_builtin_RegExp_replace (vm, n->u.vstring->data, n->u.vstring->len,
&args[1], args[2].u.vstring->data,
js_builtin_RegExp_replace (vm, (char*)n->u.vstring->data,
n->u.vstring->len, &args[1],
(char*)args[2].u.vstring->data,
args[2].u.vstring->len, result_return);
}
/* ***************************************************************** */
@ -470,8 +471,8 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
|| args[1].u.vbuiltin->info != ctx->regexp_info)
goto argument_type_error;
js_builtin_RegExp_search (vm, n->u.vstring->data, n->u.vstring->len,
&args[1], result_return);
js_builtin_RegExp_search (vm, (char*)n->u.vstring->data,
n->u.vstring->len, &args[1], result_return);
}
/* ***************************************************************** */
else if (method == ctx->s_slice)
@ -511,8 +512,8 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
if (start > end)
end = start;
js_vm_make_string (vm, result_return, n->u.vstring->data + start,
end - start);
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
start, end - start);
}
/* ***************************************************************** */
else if (method == ctx->s_split)
@ -521,7 +522,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
{
js_vm_make_array (vm, result_return, 1);
js_vm_make_string (vm, &result_return->u.varray->data[0],
n->u.vstring->data, n->u.vstring->len);
(char*)n->u.vstring->data, n->u.vstring->len);
}
else
{
@ -560,7 +561,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
js_vm_make_string (vm,
&(result_return
->u.varray->data[alen]),
n->u.vstring->data + start,
(char*)n->u.vstring->data + start,
pos - start);
alen++;
@ -585,14 +586,14 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
js_vm_expand_array (vm, result_return, alen + 1);
js_vm_make_string (vm,
&result_return->u.varray->data[alen],
n->u.vstring->data + start,
(char*)n->u.vstring->data + start,
n->u.vstring->len - start);
}
}
else if (args[1].type == JS_BUILTIN
&& args[1].u.vbuiltin->info == ctx->regexp_info)
{
js_builtin_RegExp_split (vm, n->u.vstring->data,
js_builtin_RegExp_split (vm, (char*)n->u.vstring->data,
n->u.vstring->len, &args[1],
limit, result_return);
}
@ -635,8 +636,8 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
if (start + length > n->u.vstring->len)
length = n->u.vstring->len - start;
js_vm_make_string (vm, result_return, n->u.vstring->data + start,
length);
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
start, length);
}
/* ***************************************************************** */
else if (method == ctx->s_substring)
@ -675,8 +676,8 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
js_vm_error (vm);
}
js_vm_make_string (vm, result_return, n->u.vstring->data + start,
end - start);
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data +
start, end - start);
}
/* ***************************************************************** */
else if (method == ctx->s_toLowerCase)
@ -684,7 +685,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
if (args->u.vinteger != 0)
goto argument_type_error;
js_vm_make_string (vm, result_return, n->u.vstring->data,
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
for (i = 0; i < result_return->u.vstring->len; i++)
@ -697,7 +698,7 @@ method (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info,
if (args->u.vinteger != 0)
goto argument_type_error;
js_vm_make_string (vm, result_return, n->u.vstring->data,
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
for (i = 0; i < result_return->u.vstring->len; i++)
@ -869,7 +870,7 @@ new_proc (JSVirtualMachine *vm, JSBuiltinInfo *builtin_info, JSNode *args,
source = &source_n;
}
js_vm_make_string (vm, result_return, source->u.vstring->data,
js_vm_make_string (vm, result_return, (char*)source->u.vstring->data,
source->u.vstring->len);
}
else

View file

@ -317,7 +317,7 @@ typedef enum
private to the regex routines. */
#ifndef RE_TRANSLATE_TYPE
# define RE_TRANSLATE_TYPE char *
# define RE_TRANSLATE_TYPE unsigned char *
#endif
struct re_pattern_buffer

View file

@ -24,7 +24,7 @@
/*
* $Source: /cygdrive/c/RCVS/CVS/ReactOS/reactos/lib/kjs/src/utils.c,v $
* $Id: utils.c,v 1.1 2004/01/10 20:38:18 arty Exp $
* $Id: utils.c,v 1.2 2004/12/24 23:01:35 navaraf Exp $
*/
#include "jsint.h"
@ -354,7 +354,7 @@ js_vm_to_object (JSVirtualMachine *vm, const JSNode *n, JSNode *result_return)
break;
case JS_STRING:
js_vm_make_string (vm, result_return, n->u.vstring->data,
js_vm_make_string (vm, result_return, (char*)n->u.vstring->data,
n->u.vstring->len);
break;