Skip to content

Commit

Permalink
correct use of _WCI86... macros
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalak committed Mar 16, 2024
1 parent ed3f124 commit e1f9adc
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 34 deletions.
13 changes: 4 additions & 9 deletions bld/commonui/c/bitmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2002-2021 The Open Watcom Contributors. All Rights Reserved.
* Copyright (c) 2002-2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -36,20 +36,15 @@
#include <string.h>
#ifdef _M_I86
#include <malloc.h>
#include <i86.h>
#endif
#include <dos.h>
#include "bool.h"
#include "palette.h"
#include "bitmap.h"
#include "cguimem.h"

#ifndef _WCI86HUGE
#if defined( _M_I86 )
#define _WCI86HUGE __huge
#else
#define _WCI86HUGE
#endif
#endif
#include "clibext.h"


#define HUGE_SHIFT 8
#define START_OF_HEADER sizeof( BITMAPFILEHEADER )
Expand Down
17 changes: 9 additions & 8 deletions bld/fe_misc/c/msgencod.c
Original file line number Diff line number Diff line change
Expand Up @@ -329,14 +329,14 @@ static void warn( const char *f, ... )
va_end( args );
}

static void errorLocn( const char *fn, unsigned line, const char *f, ... )
static void errorLocn( const char *fn, unsigned lineno, const char *f, ... )
{
va_list args;

++errors;
va_start( args, f );
if( line > 0 ) {
printf( "%s(%u): Error! E000: ", fn, line );
if( lineno > 0 ) {
printf( "%s(%u): Error! E000: ", fn, lineno );
}
vprintf( f, args );
va_end( args );
Expand Down Expand Up @@ -913,8 +913,7 @@ static void checkReplacements( MSGSYM *m, wres_lang_id start_lang, wres_lang_id
if( intl_text == NULL )
continue;
if( ! percentPresent( c, intl_text ) ) {
errorLocn( m->fname, m->line, "MSGSYM %s's %s text has format mismatch for %%%c\n", m->name,
langName[lang], c );
errorLocn( m->fname, m->line, "MSGSYM %s's %s text has format mismatch for %%%c\n", m->name, langName[lang], c );
}
}
}
Expand All @@ -937,14 +936,16 @@ static void checkMessages( void )
}
for( lang = start_lang; lang < end_lang; ++lang ) {
if( m->lang_txt[lang] == NULL ) {
errorLocn( m->fname, m->line, "MSGSYM %s has no %s text\n", m->name,
langName[lang] );
errorLocn( m->fname, m->line, "MSGSYM %s has no %s text\n", m->name, langName[lang] );
}
}
checkReplacements( m, start_lang, end_lang );
if( !flags.ignore_prefix ) {
switch( m->mtype ) {
#define def_msg_type( e, p ) case MSG_TYPE_##e: if( strPref( m, p ) ) errorLocn( m->fname, m->line, "MSGSYM %s has incorrect prefix (should be " p ")\n", m->name ); break;
#define def_msg_type( e, p ) case MSG_TYPE_##e: \
if( strPref( m, p ) ) \
errorLocn( m->fname, m->line, "MSGSYM %s has incorrect prefix (should be " p ")\n", m->name ); \
break;
ALL_MSG_TYPES
#undef def_msg_type
default:
Expand Down
12 changes: 4 additions & 8 deletions bld/graphlib/pgchart/h/pgstubs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -30,12 +31,7 @@
****************************************************************************/


// routines called from PGCHART.LIB

#if defined( _M_I86 )
#define _WCI86FAR __far
#else
#define _WCI86FAR
#endif

/*
* routines called from PGCHART.LIB
*/
#include "grfuncs.h"
3 changes: 1 addition & 2 deletions bld/graphlib/pgchart/h/pgvars.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -40,14 +41,12 @@


#if defined( _M_I86 )
#define _WCI86FAR __far
#define _HUGE __huge
#define StringLen _fstrlen
#define StringCopy _fstrcpy
#define MemorySet _fmemset
#define MemoryCopy _fmemcpy
#else
#define _WCI86FAR
#define _HUGE
#define StringLen strlen
#define StringCopy strcpy
Expand Down
5 changes: 1 addition & 4 deletions bld/lib_misc/h/thrdreg.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -36,11 +37,7 @@
extern "C" {
#endif

#if defined(_M_I86)
typedef void _WCI86FAR thread_fn( void _WCI86FAR * );
#else
typedef void thread_fn( void * );
#endif
typedef thread_fn __thread_fn;
#ifdef __NT__
typedef unsigned __stdcall thread_fnex( void * );
Expand Down
7 changes: 4 additions & 3 deletions bld/mathlib/c/_gr_cvt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
*
* Open Watcom Project
*
* Copyright (c) 2024 The Open Watcom Contributors. All Rights Reserved.
* Portions Copyright (c) 1983-2002 Sybase, Inc. All Rights Reserved.
*
* ========================================================================
Expand Down Expand Up @@ -35,10 +36,10 @@
#include <string.h>
#include "grfuncs.h"

#if defined( __386__ ) || defined( __AXP__ ) || defined( __PPC__ )
#define FARstrcpy strcpy
#elif defined( _M_I86 )
#if defined( _M_I86 )
#define FARstrcpy _fstrcpy
#else
#define FARstrcpy strcpy
#endif


Expand Down

0 comments on commit e1f9adc

Please sign in to comment.