mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-18 22:26:30 +01:00
cleanup (no change to generated code): remove old owner_hash code; replace empty formal lists with void.
This commit is contained in:
parent
ca7c69bff1
commit
2bba51f95a
14 changed files with 13 additions and 116 deletions
|
@ -47,7 +47,7 @@ struct MemPoolCtx {
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
|
|
||||||
MemPoolCtx*
|
MemPoolCtx*
|
||||||
mpool_make()
|
mpool_make( void )
|
||||||
{
|
{
|
||||||
MemPoolCtx* result = (MemPoolCtx*)XP_PLATMALLOC( sizeof(*result) );
|
MemPoolCtx* result = (MemPoolCtx*)XP_PLATMALLOC( sizeof(*result) );
|
||||||
XP_MEMSET( result, 0, sizeof(*result) );
|
XP_MEMSET( result, 0, sizeof(*result) );
|
||||||
|
|
|
@ -30,7 +30,7 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct MemPoolCtx MemPoolCtx;
|
typedef struct MemPoolCtx MemPoolCtx;
|
||||||
|
|
||||||
MemPoolCtx* mpool_make();
|
MemPoolCtx* mpool_make(void);
|
||||||
void mpool_destroy( MemPoolCtx* mpool );
|
void mpool_destroy( MemPoolCtx* mpool );
|
||||||
|
|
||||||
void* mpool_alloc( MemPoolCtx* mpool, XP_U32 size,
|
void* mpool_alloc( MemPoolCtx* mpool, XP_U32 size,
|
||||||
|
|
|
@ -100,10 +100,6 @@ OBJ-RES = m68k-palmos-obj-res
|
||||||
MULTILINK_OPTIONS = -basename $(ROOTNAME) -segmentsize 27k -g \
|
MULTILINK_OPTIONS = -basename $(ROOTNAME) -segmentsize 27k -g \
|
||||||
-deadstrip -verbose -gdb-script app.gdb
|
-deadstrip -verbose -gdb-script app.gdb
|
||||||
|
|
||||||
ifneq (x$(OWNERNAME)x,xx)
|
|
||||||
HASHDEF = -DOWNER_HASH=$$(./namehash $(OWNERNAME))
|
|
||||||
endif
|
|
||||||
|
|
||||||
MYDEFS_COMMON = $(PASSTHRU) -DXW_FEATURE_UTILS -DPOINTER_SUPPORT \
|
MYDEFS_COMMON = $(PASSTHRU) -DXW_FEATURE_UTILS -DPOINTER_SUPPORT \
|
||||||
-DKEY_SUPPORT -DOVERRIDE_EDGE_FOR_INDEX -DCOLOR_SUPPORT \
|
-DKEY_SUPPORT -DOVERRIDE_EDGE_FOR_INDEX -DCOLOR_SUPPORT \
|
||||||
-DSHOW_PROGRESS $(HASHDEF) -DNO_REG_REQUIRED -DPERIMETER_FOCUS
|
-DSHOW_PROGRESS $(HASHDEF) -DNO_REG_REQUIRED -DPERIMETER_FOCUS
|
||||||
|
@ -302,8 +298,6 @@ LocalizedStrIncludes.h StrL03e8.bin: \
|
||||||
./mkstrsres StrL03e8.bin LocalizedStrIncludes.h
|
./mkstrsres StrL03e8.bin LocalizedStrIncludes.h
|
||||||
rm -f mkstrsres
|
rm -f mkstrsres
|
||||||
|
|
||||||
namehash: namehash.c ownerhash.h
|
|
||||||
|
|
||||||
ifneq (x$(BUILD_AS_PNOLET)x, xx)
|
ifneq (x$(BUILD_AS_PNOLET)x, xx)
|
||||||
.PHONY : pnolet
|
.PHONY : pnolet
|
||||||
|
|
||||||
|
|
|
@ -42,7 +42,6 @@ countGameRecords( PalmAppGlobals* globals )
|
||||||
return numRecs;
|
return numRecs;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
void
|
void
|
||||||
deleteGameRecord( PalmAppGlobals* globals, XP_S16 index )
|
deleteGameRecord( PalmAppGlobals* globals, XP_S16 index )
|
||||||
{
|
{
|
||||||
|
@ -82,7 +81,6 @@ duplicateGameRecord( PalmAppGlobals* globals, XP_S16 fromIndex )
|
||||||
|
|
||||||
return newIndex;
|
return newIndex;
|
||||||
} /* duplicateGameRecord */
|
} /* duplicateGameRecord */
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
streamToGameRecord( PalmAppGlobals* globals, XWStreamCtxt* stream,
|
streamToGameRecord( PalmAppGlobals* globals, XWStreamCtxt* stream,
|
||||||
|
|
|
@ -54,10 +54,6 @@
|
||||||
"turn trading tiles?" },
|
"turn trading tiles?" },
|
||||||
{ "STR_TRADING_REMINDER", "Click D when done." },
|
{ "STR_TRADING_REMINDER", "Click D when done." },
|
||||||
|
|
||||||
#ifndef NO_REG_REQUIRED
|
|
||||||
{ "STR_NOT_UNREG_VERS", "Feature not available in unregistered version." },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ "STR_LOCAL_NAME", "%s" },
|
{ "STR_LOCAL_NAME", "%s" },
|
||||||
{ "STR_NONLOCAL_NAME", "%s (remote)" },
|
{ "STR_NONLOCAL_NAME", "%s (remote)" },
|
||||||
{ "STRSD_SUMMARYSCORED", "%s:%d" },
|
{ "STRSD_SUMMARYSCORED", "%s:%d" },
|
||||||
|
|
|
@ -57,10 +57,6 @@
|
||||||
"vos lettres ?" },
|
"vos lettres ?" },
|
||||||
{ "STR_TRADING_REMINDER", "Cliquez D une fois fini." },
|
{ "STR_TRADING_REMINDER", "Cliquez D une fois fini." },
|
||||||
|
|
||||||
#ifndef NO_REG_REQUIRED
|
|
||||||
{ "STR_NOT_UNREG_VERS", "Disposition non disponible dans la version non enregistrée." },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ "STR_LOCAL_NAME", "%s" },
|
{ "STR_LOCAL_NAME", "%s" },
|
||||||
{ "STR_NONLOCAL_NAME", "%s (remote)" },
|
{ "STR_NONLOCAL_NAME", "%s (remote)" },
|
||||||
{ "STRSD_SUMMARYSCORED", "%s:%d" },
|
{ "STRSD_SUMMARYSCORED", "%s:%d" },
|
||||||
|
|
|
@ -1,34 +0,0 @@
|
||||||
/* -*-mode: C; fill-column: 77; c-basic-offset: 4; -*- */
|
|
||||||
/*
|
|
||||||
* Copyright 1999 - 2002 by Eric House (xwords@eehouse.org). All rights reserved.
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License
|
|
||||||
* as published by the Free Software Foundation; either version 2
|
|
||||||
* of the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, write to the Free Software
|
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
||||||
*/
|
|
||||||
|
|
||||||
#ifndef _OWNERHASH_H_
|
|
||||||
#ifndef NO_REG_REQUIRED
|
|
||||||
static unsigned long
|
|
||||||
my_hash( unsigned char* str ) {
|
|
||||||
unsigned char ch;
|
|
||||||
unsigned long result = 0;
|
|
||||||
while ( ( ch = *str++ ) != '\0' ) {
|
|
||||||
result += result << 2 ^ ~ch;
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
} /* my_hash */
|
|
||||||
|
|
||||||
#define HASH(s) my_hash(s)
|
|
||||||
#endif
|
|
||||||
#endif
|
|
|
@ -123,7 +123,7 @@ void flipBtSocketListenInfoArm268K( unsigned char* out,
|
||||||
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_68K_TO_ARM( out, in ) /* nothing for now */
|
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_68K_TO_ARM( out, in ) /* nothing for now */
|
||||||
#endif /* XWFEATURE_BLUETOOTH */
|
#endif /* XWFEATURE_BLUETOOTH */
|
||||||
|
|
||||||
PNOState* getStorageLoc();
|
PNOState* getStorageLoc(void);
|
||||||
#define GET_CALLBACK_STATE() getStorageLoc()
|
#define GET_CALLBACK_STATE() getStorageLoc()
|
||||||
|
|
||||||
#define crash() *(int*)1L = 1
|
#define crash() *(int*)1L = 1
|
||||||
|
|
|
@ -1192,7 +1192,7 @@ startApplication( PalmAppGlobals** globalsP )
|
||||||
/* if we're here because dict missing, don't re-init all prefs! */
|
/* if we're here because dict missing, don't re-init all prefs! */
|
||||||
if ( !prefsFound ) {
|
if ( !prefsFound ) {
|
||||||
palmInitPrefs( globals );
|
palmInitPrefs( globals );
|
||||||
} else if ( checkUserName() ) {
|
} else {
|
||||||
/* increment count so we get a new game rather than replace
|
/* increment count so we get a new game rather than replace
|
||||||
existing one. We want it still there if somebody puts the
|
existing one. We want it still there if somebody puts the
|
||||||
missing dict back. */
|
missing dict back. */
|
||||||
|
@ -1328,13 +1328,11 @@ stopApplication( PalmAppGlobals* globals )
|
||||||
XP_FREE( globals->mpool, globals->prefsDlgState );
|
XP_FREE( globals->mpool, globals->prefsDlgState );
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
if ( !!globals->savedGamesState && !globals->isFirstLaunch ) {
|
if ( !!globals->savedGamesState && !globals->isFirstLaunch ) {
|
||||||
freeSavedGamesData( MPPARM(globals->mpool)
|
freeSavedGamesData( MPPARM(globals->mpool)
|
||||||
globals->savedGamesState );
|
globals->savedGamesState );
|
||||||
XP_FREE( globals->mpool, globals->savedGamesState );
|
XP_FREE( globals->mpool, globals->savedGamesState );
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
uninitHighResGlobals( globals );
|
uninitHighResGlobals( globals );
|
||||||
|
|
||||||
|
@ -1504,11 +1502,9 @@ applicationHandleEvent( EventPtr event )
|
||||||
handler = ConnsFormHandleEvent;
|
handler = ConnsFormHandleEvent;
|
||||||
break;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
case XW_SAVEDGAMES_DIALOG_ID:
|
case XW_SAVEDGAMES_DIALOG_ID:
|
||||||
handler = savedGamesHandleEvent;
|
handler = savedGamesHandleEvent;
|
||||||
break;
|
break;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if ( !!handler ) {
|
if ( !!handler ) {
|
||||||
XP_ASSERT( !!frm );
|
XP_ASSERT( !!frm );
|
||||||
|
@ -2681,20 +2677,11 @@ mainViewHandleEvent( EventPtr event )
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XW_SAVEDGAMES_PULLDOWN_ID:
|
case XW_SAVEDGAMES_PULLDOWN_ID:
|
||||||
if ( 0 ) {
|
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
} else if ( checkUserName() ) {
|
|
||||||
saveOpenGame( globals );/* so it can be accurately duped */
|
saveOpenGame( globals );/* so it can be accurately duped */
|
||||||
/* save game changes state; reflect on screen before
|
/* save game changes state; reflect on screen before
|
||||||
popping up dialog */
|
popping up dialog */
|
||||||
drawChangedBoard( globals );
|
drawChangedBoard( globals );
|
||||||
FrmPopupForm( XW_SAVEDGAMES_DIALOG_ID );
|
FrmPopupForm( XW_SAVEDGAMES_DIALOG_ID );
|
||||||
#endif
|
|
||||||
#ifndef NO_REG_REQUIRED
|
|
||||||
} else {
|
|
||||||
userErrorFromStrId( globals, STR_NOT_UNREG_VERS );
|
|
||||||
#endif
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case XW_FINISH_PULLDOWN_ID:
|
case XW_FINISH_PULLDOWN_ID:
|
||||||
|
@ -2968,14 +2955,12 @@ askStartNewGame( PalmAppGlobals* globals )
|
||||||
/* do nothing; popping up the NEWGAMES dlg will do it -- if not
|
/* do nothing; popping up the NEWGAMES dlg will do it -- if not
|
||||||
cancelled */
|
cancelled */
|
||||||
globals->newGameIsNew = XP_FALSE;
|
globals->newGameIsNew = XP_FALSE;
|
||||||
} else if ( checkUserName() ) {
|
} else {
|
||||||
saveOpenGame( globals );
|
saveOpenGame( globals );
|
||||||
|
|
||||||
drawChangedBoard( globals );
|
drawChangedBoard( globals );
|
||||||
|
|
||||||
globals->newGameIsNew = XP_TRUE;
|
globals->newGameIsNew = XP_TRUE;
|
||||||
} else {
|
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
globals->isNewGame = true;
|
globals->isNewGame = true;
|
||||||
globals->isFirstLaunch = false;
|
globals->isFirstLaunch = false;
|
||||||
|
|
|
@ -233,9 +233,7 @@ typedef enum {
|
||||||
struct PalmAppGlobals {
|
struct PalmAppGlobals {
|
||||||
FormPtr mainForm;
|
FormPtr mainForm;
|
||||||
PrefsDlgState* prefsDlgState;
|
PrefsDlgState* prefsDlgState;
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
SavedGamesState* savedGamesState;
|
SavedGamesState* savedGamesState;
|
||||||
#endif
|
|
||||||
XWGame game;
|
XWGame game;
|
||||||
DrawCtx* draw;
|
DrawCtx* draw;
|
||||||
XW_UtilCtxt util;
|
XW_UtilCtxt util;
|
||||||
|
|
|
@ -19,8 +19,6 @@
|
||||||
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#if defined OWNER_HASH || defined NO_REG_REQUIRED
|
|
||||||
|
|
||||||
#include <PalmTypes.h>
|
#include <PalmTypes.h>
|
||||||
#include <Form.h>
|
#include <Form.h>
|
||||||
#include <DLServer.h>
|
#include <DLServer.h>
|
||||||
|
@ -31,7 +29,6 @@
|
||||||
#include "palmmain.h"
|
#include "palmmain.h"
|
||||||
#include "palmutil.h"
|
#include "palmutil.h"
|
||||||
#include "gameutil.h"
|
#include "gameutil.h"
|
||||||
#include "ownerhash.h"
|
|
||||||
|
|
||||||
#include "xwords4defines.h"
|
#include "xwords4defines.h"
|
||||||
#include "LocalizedStrIncludes.h"
|
#include "LocalizedStrIncludes.h"
|
||||||
|
@ -41,29 +38,6 @@ static void populateGameList( SavedGamesState* state );
|
||||||
static void setFieldToSelText( SavedGamesState* state );
|
static void setFieldToSelText( SavedGamesState* state );
|
||||||
static void listDrawFunc(Int16 index, RectanglePtr bounds, char** itemsText);
|
static void listDrawFunc(Int16 index, RectanglePtr bounds, char** itemsText);
|
||||||
|
|
||||||
#ifndef NO_REG_REQUIRED
|
|
||||||
Boolean
|
|
||||||
checkUserName()
|
|
||||||
{
|
|
||||||
#ifdef FOR_GREMLINS
|
|
||||||
return true;
|
|
||||||
#else
|
|
||||||
XP_UCHAR ownerName[dlkMaxUserNameLength + 1];
|
|
||||||
Boolean result;
|
|
||||||
Err err;
|
|
||||||
|
|
||||||
ownerName[0] = '\0';
|
|
||||||
/* Try and use the user's name */
|
|
||||||
err = DlkGetSyncInfo( NULL, NULL, NULL, ownerName, NULL, NULL );
|
|
||||||
XP_ASSERT( err == 0 );
|
|
||||||
|
|
||||||
result = HASH(ownerName)==((unsigned long)OWNER_HASH);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
#endif
|
|
||||||
} /* checkUserName */
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*****************************************************************************
|
/*****************************************************************************
|
||||||
* Handler for dictionary info form.
|
* Handler for dictionary info form.
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
@ -286,5 +260,3 @@ listDrawFunc( Int16 index, RectanglePtr bounds, char** itemsText )
|
||||||
|
|
||||||
CALLBACK_EPILOGUE();
|
CALLBACK_EPILOGUE();
|
||||||
} /* listDrawFunc */
|
} /* listDrawFunc */
|
||||||
|
|
||||||
#endif /* OWNER_HASH */
|
|
||||||
|
|
|
@ -28,12 +28,4 @@ typedef struct OpenSavedGameData {
|
||||||
|
|
||||||
Boolean savedGamesHandleEvent( EventPtr event );
|
Boolean savedGamesHandleEvent( EventPtr event );
|
||||||
|
|
||||||
#if defined NO_REG_REQUIRED
|
|
||||||
# define checkUserName() XP_TRUE
|
|
||||||
#elif defined OWNER_HASH
|
|
||||||
Boolean checkUserName();
|
|
||||||
#else
|
|
||||||
# define checkUserName() XP_FALSE
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -87,7 +87,7 @@ XP_Bool tryRockerKey( XP_U16 key, XP_U16 selGadget,
|
||||||
# endif
|
# endif
|
||||||
|
|
||||||
void setFormRefcon( void* refcon );
|
void setFormRefcon( void* refcon );
|
||||||
void* getFormRefcon();
|
void* getFormRefcon(void);
|
||||||
void fitButtonToString( XP_U16 id );
|
void fitButtonToString( XP_U16 id );
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -144,10 +144,10 @@ realArmletEntryPoint( const void *emulStateP,
|
||||||
|
|
||||||
asm( "mov r10, %0" : : "r" (oldR10) );
|
asm( "mov r10, %0" : : "r" (oldR10) );
|
||||||
return result;
|
return result;
|
||||||
}
|
} /* realArmletEntryPoint( */
|
||||||
|
|
||||||
PNOState*
|
PNOState*
|
||||||
getStorageLoc()
|
getStorageLoc( void )
|
||||||
{
|
{
|
||||||
asm( "adr r0,data" );
|
asm( "adr r0,data" );
|
||||||
asm( "mov pc,lr" );
|
asm( "mov pc,lr" );
|
||||||
|
|
Loading…
Reference in a new issue