Add MAXINTATOM to winbase.h
Francois Gouget
fgouget at free.fr
Fri Oct 12 21:55:50 CDT 2001
Changelog:
* include/winbase.h,
memory/atom.c
Add INVALID_ATOM and MAXINTATOM to winbase.h
Replace MIN_STR_ATOM with MAXINTATOM
--
Francois Gouget fgouget at free.fr http://fgouget.free.fr/
Broadcast message : fin du monde dans cinq minutes, repentez vous !
-------------- next part --------------
Index: include/winbase.h
===================================================================
RCS file: /home/wine/wine/include/winbase.h,v
retrieving revision 1.126
diff -u -r1.126 winbase.h
--- include/winbase.h 2001/10/12 18:43:27 1.126
+++ include/winbase.h 2001/10/13 00:13:39
@@ -409,6 +409,8 @@
#define GHND (GMEM_MOVEABLE | GMEM_ZEROINIT)
#define GPTR (GMEM_FIXED | GMEM_ZEROINIT)
+#define INVALID_ATOM ((ATOM)0)
+#define MAXINTATOM 0xc000
#define MAKEINTATOMA(atom) ((LPCSTR)((ULONG_PTR)((WORD)(atom))))
#define MAKEINTATOMW(atom) ((LPCWSTR)((ULONG_PTR)((WORD)(atom))))
#define MAKEINTATOM WINELIB_NAME_AW(MAKEINTATOM)
Index: memory/atom.c
===================================================================
RCS file: /home/wine/wine/memory/atom.c,v
retrieving revision 1.37
diff -u -r1.37 atom.c
--- memory/atom.c 2001/10/12 18:45:30 1.37
+++ memory/atom.c 2001/10/13 00:21:33
@@ -19,6 +19,7 @@
#include <ctype.h>
#include "windef.h"
+#include "winbase.h"
#include "winerror.h"
#include "wine/server.h"
@@ -33,7 +34,6 @@
DEFAULT_DEBUG_CHANNEL(atom);
#define DEFAULT_ATOMTABLE_SIZE 37
-#define MIN_STR_ATOM 0xc000
#define MAX_ATOM_LEN 255
#define ATOMTOHANDLE(atom) ((HANDLE16)(atom) << 2)
@@ -129,7 +129,7 @@
}
if (*atomstr) return FALSE;
}
- if (!atom || (atom >= MIN_STR_ATOM))
+ if ((atom==INVALID_ATOM) || (atom >= MAXINTATOM))
{
SetLastError( ERROR_INVALID_PARAMETER );
atom = 0;
@@ -156,7 +156,7 @@
}
if (*atomstr) return FALSE;
}
- if (!atom || (atom >= MIN_STR_ATOM))
+ if ((atom==INVALID_ATOM) || (atom >= MAXINTATOM))
{
SetLastError( ERROR_INVALID_PARAMETER );
atom = 0;
@@ -218,7 +218,7 @@
*/
HANDLE16 WINAPI GetAtomHandle16( ATOM atom )
{
- if (atom < MIN_STR_ATOM) return 0;
+ if (atom < MAXINTATOM) return 0;
return ATOMTOHANDLE( atom );
}
@@ -299,7 +299,7 @@
HANDLE16 entry, *prevEntry;
WORD hash;
- if (atom < MIN_STR_ATOM) return 0; /* Integer atom */
+ if (atom < MAXINTATOM) return 0; /* Integer atom */
if (CURRENT_DS == ATOM_UserDS) return GlobalDeleteAtom( atom );
TRACE("0x%x\n",atom);
@@ -380,7 +380,7 @@
TRACE("%x\n",atom);
if (!count) return 0;
- if (atom < MIN_STR_ATOM)
+ if (atom < MAXINTATOM)
{
sprintf( text, "#%d", atom );
len = strlen(text);
@@ -516,7 +516,7 @@
static ATOM ATOM_DeleteAtom( ATOM atom, BOOL local)
{
TRACE( "(%s) %x\n", local ? "local" : "global", atom );
- if (atom < MIN_STR_ATOM) atom = 0;
+ if (atom < MAXINTATOM) atom = 0;
else
{
SERVER_START_REQ( delete_atom )
@@ -666,10 +666,10 @@
SetLastError( ERROR_MORE_DATA );
return 0;
}
- if (atom < MIN_STR_ATOM)
+ if (atom < MAXINTATOM)
{
char name[8];
- if (!atom)
+ if (atom==INVALID_ATOM)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
@@ -751,10 +751,10 @@
SetLastError( ERROR_MORE_DATA );
return 0;
}
- if (atom < MIN_STR_ATOM)
+ if (atom < MAXINTATOM)
{
char name[8];
- if (!atom)
+ if (atom==INVALID_ATOM)
{
SetLastError( ERROR_INVALID_PARAMETER );
return 0;
More information about the wine-patches
mailing list