Sync to Wine-20040419:
Jon Griffiths <jon_p_griffiths(a)yahoo.com>
- -Wunsigned fixes.
Alexandre Julliard <julliard(a)winehq.org>
- Use the correct file name in the "generated automatically" comments.
- Don't crash on xrealloc(0) (found by Jon Griffiths).
Marcus Meissner <meissner(a)suse.de>
- Use correct movw instead of movl when handling segment registers.
Modified: trunk/reactos/tools/winebuild/build.h
Modified: trunk/reactos/tools/winebuild/main.c
Modified: trunk/reactos/tools/winebuild/relay.c
Modified: trunk/reactos/tools/winebuild/res16.c
Modified: trunk/reactos/tools/winebuild/res32.c
Modified: trunk/reactos/tools/winebuild/spec32.c
Modified: trunk/reactos/tools/winebuild/utils.c
_____
Modified: trunk/reactos/tools/winebuild/build.h
--- trunk/reactos/tools/winebuild/build.h 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/build.h 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -98,7 +98,7 @@
int nb_entry_points; /* number of used entry points
*/
int alloc_entry_points; /* number of allocated entry
points */
int nb_names; /* number of entry points with
names */
- int nb_resources; /* number of resources */
+ unsigned int nb_resources; /* number of resources */
int characteristics; /* characteristics for the PE
header */
int subsystem; /* subsystem id */
int subsystem_major; /* subsystem version major
number */
@@ -203,6 +203,7 @@
extern int kill_at;
extern char *input_file_name;
+extern char *spec_file_name;
extern const char *output_file_name;
extern char **debug_channels;
extern char **lib_path;
_____
Modified: trunk/reactos/tools/winebuild/main.c
--- trunk/reactos/tools/winebuild/main.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/main.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -56,6 +56,7 @@
char **lib_path = NULL;
char *input_file_name = NULL;
+char *spec_file_name = NULL;
const char *output_file_name = NULL;
char *ld_command = "ld";
@@ -65,7 +66,6 @@
static const char *current_src_dir;
static int nb_res_files;
static char **res_files;
-static char *spec_file_name;
/* execution mode */
enum exec_mode_values
_____
Modified: trunk/reactos/tools/winebuild/relay.c
--- trunk/reactos/tools/winebuild/relay.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/relay.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -171,7 +171,7 @@
else
fprintf( outfile, "\tmovw "
__ASM_NAME("CallTo16_TebSelector")
", %%fs\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl (%d),%%gs\n",
STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov (%d),%%gs\n",
STRUCTOFFSET(TEB,gs_sel) );
/* Get address of wine_ldt_copy array into %ecx */
if ( UsePIC )
@@ -481,7 +481,7 @@
fprintf( outfile, "\tpushl %%ebx\n" );
fprintf( outfile, "\tpushl %%esi\n" );
fprintf( outfile, "\tpushl %%edi\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl %%gs,(%d)\n",
STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov %%gs,(%d)\n",
STRUCTOFFSET(TEB,gs_sel) );
/* Setup exception frame */
fprintf( outfile, "\t.byte 0x64\n\tpushl (%d)\n", STACKOFFSET );
@@ -635,9 +635,9 @@
#endif
fprintf( outfile, "\tmovw %%di,%%es\n" );
- fprintf( outfile, "\t.byte 0x2e\n\tmovl "
__ASM_NAME("CallTo16_TebSelector") "-"
__ASM_NAME("Call16_Ret_Start")
",%%fs\n" );
+ fprintf( outfile, "\t.byte 0x2e\n\tmov "
__ASM_NAME("CallTo16_TebSelector") "-"
__ASM_NAME("Call16_Ret_Start")
",%%fs\n" );
- fprintf( outfile, "\t.byte 0x64\n\tmovl (%d),%%gs\n",
STRUCTOFFSET(TEB,gs_sel) );
+ fprintf( outfile, "\t.byte 0x64\n\tmov (%d),%%gs\n",
STRUCTOFFSET(TEB,gs_sel) );
/* Restore the 32-bit stack */
_____
Modified: trunk/reactos/tools/winebuild/res16.c
--- trunk/reactos/tools/winebuild/res16.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/res16.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -215,7 +215,7 @@
/* build the 2-level (type,name) resource tree */
static struct res_tree *build_resource_tree( DLLSPEC *spec )
{
- int i;
+ unsigned int i;
struct res_tree *tree;
struct res_type *type = NULL;
@@ -270,7 +270,8 @@
{
const struct resource *res;
unsigned char *buffer, *p;
- int i, total;
+ unsigned int i;
+ int total;
if (!spec->nb_resources) return 0;
@@ -292,8 +293,8 @@
/* output the resource definitions */
int output_res16_directory( unsigned char *buffer, DLLSPEC *spec )
{
- int i, offset, res_offset = 0;
- unsigned int j;
+ int offset, res_offset = 0;
+ unsigned int i, j;
struct res_tree *tree;
const struct res_type *type;
const struct resource *res;
_____
Modified: trunk/reactos/tools/winebuild/res32.c
--- trunk/reactos/tools/winebuild/res32.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/res32.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -267,7 +267,7 @@
/* build the 3-level (type,name,language) resource tree */
static struct res_tree *build_resource_tree( DLLSPEC *spec )
{
- int i;
+ unsigned int i;
struct res_tree *tree;
struct res_type *type = NULL;
struct res_name *name = NULL;
@@ -297,7 +297,7 @@
/* free the resource tree */
static void free_resource_tree( struct res_tree *tree )
{
- int i;
+ unsigned int i;
for (i = 0; i < tree->nb_types; i++) free( tree->types[i].names );
free( tree->types );
@@ -318,8 +318,8 @@
/* output the resource definitions */
void output_resources( FILE *outfile, DLLSPEC *spec )
{
- int i, j, k, nb_id_types;
- unsigned int n, offset, data_offset;
+ int j, k, nb_id_types;
+ unsigned int i, n, offset, data_offset;
struct res_tree *tree;
struct res_type *type;
struct res_name *name;
_____
Modified: trunk/reactos/tools/winebuild/spec32.c
--- trunk/reactos/tools/winebuild/spec32.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/spec32.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -846,8 +846,11 @@
const char *name;
int i;
- fprintf(outfile, "; File generated automatically from %s; do not
edit!\n\n",
- input_file_name );
+ if (spec_file_name)
+ fprintf( outfile, "; File generated automatically from %s; do
not edit!\n\n",
+ spec_file_name );
+ else
+ fprintf( outfile, "; File generated automatically; do not
edit!\n\n" );
fprintf(outfile, "LIBRARY %s\n\n", spec->file_name);
_____
Modified: trunk/reactos/tools/winebuild/utils.c
--- trunk/reactos/tools/winebuild/utils.c 2005-04-25 07:58:24 UTC
(rev 14795)
+++ trunk/reactos/tools/winebuild/utils.c 2005-04-25 08:26:29 UTC
(rev 14796)
@@ -48,7 +48,7 @@
void *xrealloc (void *ptr, size_t size)
{
void *res = realloc (ptr, size);
- if (res == NULL)
+ if (size && res == NULL)
{
fprintf (stderr, "Virtual memory exhausted.\n");
exit (1);
@@ -145,9 +145,9 @@
/* output a standard header for generated files */
void output_standard_file_header( FILE *outfile )
{
- if (input_file_name)
+ if (spec_file_name)
fprintf( outfile, "/* File generated automatically from %s; do
not edit! */\n",
- input_file_name );
+ spec_file_name );
else
fprintf( outfile, "/* File generated automatically; do not
edit! */\n" );
fprintf( outfile,