Sync to Wine-20040419:

Jon Griffiths <jon_p_griffiths@yahoo.com>
- -Wunsigned fixes.
Alexandre Julliard <julliard@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@suse.de>
- Use correct movw instead of movl when handling segment registers.

svn path=/trunk/; revision=14796
This commit is contained in:
Gé van Geldorp 2005-04-25 08:26:29 +00:00
parent 1900553907
commit c782c3c14d
7 changed files with 24 additions and 19 deletions

View file

@ -98,7 +98,7 @@ typedef struct
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 display_warnings;
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;

View file

@ -56,6 +56,7 @@ char **debug_channels = NULL;
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 FILE *output_file;
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

View file

@ -171,7 +171,7 @@ static void BuildCallFrom16Core( FILE *outfile, int reg_func, int thunk, int sho
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 @@ static void BuildCallTo16Core( FILE *outfile, int reg_func )
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 @@ static void BuildRet16Func( FILE *outfile )
#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 */

View file

@ -215,7 +215,7 @@ static int cmp_res( const void *ptr1, const void *ptr2 )
/* 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 @@ int output_res16_data( FILE *outfile, DLLSPEC *spec )
{
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 @@ int output_res16_data( FILE *outfile, DLLSPEC *spec )
/* 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;

View file

@ -267,7 +267,7 @@ static int cmp_res( const void *ptr1, const void *ptr2 )
/* 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 @@ static struct res_tree *build_resource_tree( DLLSPEC *spec )
/* 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 @@ static void output_string( FILE *outfile, const WCHAR *name )
/* 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;

View file

@ -846,8 +846,11 @@ void BuildDef32File( FILE *outfile, DLLSPEC *spec )
const char *name;
int i;
if (spec_file_name)
fprintf( outfile, "; File generated automatically from %s; do not edit!\n\n",
input_file_name );
spec_file_name );
else
fprintf( outfile, "; File generated automatically; do not edit!\n\n" );
fprintf(outfile, "LIBRARY %s\n\n", spec->file_name);

View file

@ -48,7 +48,7 @@ void *xmalloc (size_t size)
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 @@ void warning( const char *msg, ... )
/* 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,