cleanup (no change to generated code): remove old owner_hash code; replace empty formal lists with void.

This commit is contained in:
ehouse 2007-04-14 16:27:19 +00:00
parent a42475dd48
commit 2f52acd5e6
14 changed files with 13 additions and 116 deletions

View file

@ -47,7 +47,7 @@ struct MemPoolCtx {
/*--------------------------------------------------------------------------*/
MemPoolCtx*
mpool_make()
mpool_make( void )
{
MemPoolCtx* result = (MemPoolCtx*)XP_PLATMALLOC( sizeof(*result) );
XP_MEMSET( result, 0, sizeof(*result) );

View file

@ -30,7 +30,7 @@ extern "C" {
typedef struct MemPoolCtx MemPoolCtx;
MemPoolCtx* mpool_make();
MemPoolCtx* mpool_make(void);
void mpool_destroy( MemPoolCtx* mpool );
void* mpool_alloc( MemPoolCtx* mpool, XP_U32 size,

View file

@ -100,10 +100,6 @@ OBJ-RES = m68k-palmos-obj-res
MULTILINK_OPTIONS = -basename $(ROOTNAME) -segmentsize 27k -g \
-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 \
-DKEY_SUPPORT -DOVERRIDE_EDGE_FOR_INDEX -DCOLOR_SUPPORT \
-DSHOW_PROGRESS $(HASHDEF) -DNO_REG_REQUIRED -DPERIMETER_FOCUS
@ -302,8 +298,6 @@ LocalizedStrIncludes.h StrL03e8.bin: \
./mkstrsres StrL03e8.bin LocalizedStrIncludes.h
rm -f mkstrsres
namehash: namehash.c ownerhash.h
ifneq (x$(BUILD_AS_PNOLET)x, xx)
.PHONY : pnolet

View file

@ -42,7 +42,6 @@ countGameRecords( PalmAppGlobals* globals )
return numRecs;
}
#if defined OWNER_HASH || defined NO_REG_REQUIRED
void
deleteGameRecord( PalmAppGlobals* globals, XP_S16 index )
{
@ -82,7 +81,6 @@ duplicateGameRecord( PalmAppGlobals* globals, XP_S16 fromIndex )
return newIndex;
} /* duplicateGameRecord */
#endif
void
streamToGameRecord( PalmAppGlobals* globals, XWStreamCtxt* stream,

View file

@ -54,10 +54,6 @@
"turn trading tiles?" },
{ "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_NONLOCAL_NAME", "%s (remote)" },
{ "STRSD_SUMMARYSCORED", "%s:%d" },

View file

@ -57,10 +57,6 @@
"vos lettres ?" },
{ "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_NONLOCAL_NAME", "%s (remote)" },
{ "STRSD_SUMMARYSCORED", "%s:%d" },

View file

@ -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

View file

@ -123,7 +123,7 @@ void flipBtSocketListenInfoArm268K( unsigned char* out,
# define SWAP_BTLIBSOCKETLISTENINFOTYPE_68K_TO_ARM( out, in ) /* nothing for now */
#endif /* XWFEATURE_BLUETOOTH */
PNOState* getStorageLoc();
PNOState* getStorageLoc(void);
#define GET_CALLBACK_STATE() getStorageLoc()
#define crash() *(int*)1L = 1

View file

@ -1192,7 +1192,7 @@ startApplication( PalmAppGlobals** globalsP )
/* if we're here because dict missing, don't re-init all prefs! */
if ( !prefsFound ) {
palmInitPrefs( globals );
} else if ( checkUserName() ) {
} else {
/* increment count so we get a new game rather than replace
existing one. We want it still there if somebody puts the
missing dict back. */
@ -1328,13 +1328,11 @@ stopApplication( PalmAppGlobals* globals )
XP_FREE( globals->mpool, globals->prefsDlgState );
}
#if defined OWNER_HASH || defined NO_REG_REQUIRED
if ( !!globals->savedGamesState && !globals->isFirstLaunch ) {
freeSavedGamesData( MPPARM(globals->mpool)
globals->savedGamesState );
XP_FREE( globals->mpool, globals->savedGamesState );
}
#endif
uninitHighResGlobals( globals );
@ -1504,11 +1502,9 @@ applicationHandleEvent( EventPtr event )
handler = ConnsFormHandleEvent;
break;
#endif
#if defined OWNER_HASH || defined NO_REG_REQUIRED
case XW_SAVEDGAMES_DIALOG_ID:
handler = savedGamesHandleEvent;
break;
#endif
}
if ( !!handler ) {
XP_ASSERT( !!frm );
@ -2681,20 +2677,11 @@ mainViewHandleEvent( EventPtr event )
break;
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 */
/* save game changes state; reflect on screen before
popping up dialog */
drawChangedBoard( globals );
FrmPopupForm( XW_SAVEDGAMES_DIALOG_ID );
#endif
#ifndef NO_REG_REQUIRED
} else {
userErrorFromStrId( globals, STR_NOT_UNREG_VERS );
#endif
}
saveOpenGame( globals );/* so it can be accurately duped */
/* save game changes state; reflect on screen before
popping up dialog */
drawChangedBoard( globals );
FrmPopupForm( XW_SAVEDGAMES_DIALOG_ID );
break;
case XW_FINISH_PULLDOWN_ID:
@ -2968,14 +2955,12 @@ askStartNewGame( PalmAppGlobals* globals )
/* do nothing; popping up the NEWGAMES dlg will do it -- if not
cancelled */
globals->newGameIsNew = XP_FALSE;
} else if ( checkUserName() ) {
} else {
saveOpenGame( globals );
drawChangedBoard( globals );
globals->newGameIsNew = XP_TRUE;
} else {
return;
}
globals->isNewGame = true;
globals->isFirstLaunch = false;

View file

@ -233,9 +233,7 @@ typedef enum {
struct PalmAppGlobals {
FormPtr mainForm;
PrefsDlgState* prefsDlgState;
#if defined OWNER_HASH || defined NO_REG_REQUIRED
SavedGamesState* savedGamesState;
#endif
XWGame game;
DrawCtx* draw;
XW_UtilCtxt util;

View file

@ -19,8 +19,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
****************************************************************************/
#if defined OWNER_HASH || defined NO_REG_REQUIRED
#include <PalmTypes.h>
#include <Form.h>
#include <DLServer.h>
@ -31,7 +29,6 @@
#include "palmmain.h"
#include "palmutil.h"
#include "gameutil.h"
#include "ownerhash.h"
#include "xwords4defines.h"
#include "LocalizedStrIncludes.h"
@ -41,29 +38,6 @@ static void populateGameList( SavedGamesState* state );
static void setFieldToSelText( SavedGamesState* state );
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.
****************************************************************************/
@ -286,5 +260,3 @@ listDrawFunc( Int16 index, RectanglePtr bounds, char** itemsText )
CALLBACK_EPILOGUE();
} /* listDrawFunc */
#endif /* OWNER_HASH */

View file

@ -28,12 +28,4 @@ typedef struct OpenSavedGameData {
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

View file

@ -87,7 +87,7 @@ XP_Bool tryRockerKey( XP_U16 key, XP_U16 selGadget,
# endif
void setFormRefcon( void* refcon );
void* getFormRefcon();
void* getFormRefcon(void);
void fitButtonToString( XP_U16 id );

View file

@ -144,10 +144,10 @@ realArmletEntryPoint( const void *emulStateP,
asm( "mov r10, %0" : : "r" (oldR10) );
return result;
}
} /* realArmletEntryPoint( */
PNOState*
getStorageLoc()
getStorageLoc( void )
{
asm( "adr r0,data" );
asm( "mov pc,lr" );