make formal params const where possible

This commit is contained in:
ehouse 2006-09-02 05:30:51 +00:00
parent 4322fd2820
commit 41a36b2352
2 changed files with 20 additions and 19 deletions

View file

@ -99,8 +99,8 @@ dict_numTileFaces( const DictionaryCtxt* dict )
} /* dict_numTileFaces */ } /* dict_numTileFaces */
XP_U16 XP_U16
dict_tilesToString( const DictionaryCtxt* ctxt, Tile* tiles, XP_U16 nTiles, dict_tilesToString( const DictionaryCtxt* ctxt, const Tile* tiles,
XP_UCHAR* buf, XP_U16 bufSize ) XP_U16 nTiles, XP_UCHAR* buf, XP_U16 bufSize )
{ {
XP_UCHAR* bufp = buf; XP_UCHAR* bufp = buf;
XP_UCHAR* end = bufp + bufSize; XP_UCHAR* end = bufp + bufSize;
@ -139,7 +139,7 @@ dict_tilesToString( const DictionaryCtxt* ctxt, Tile* tiles, XP_U16 nTiles,
} /* dict_tilesToString */ } /* dict_tilesToString */
Tile Tile
dict_tileForString( DictionaryCtxt* dict, XP_UCHAR* key ) dict_tileForString( const DictionaryCtxt* dict, const XP_UCHAR* key )
{ {
XP_U16 nFaces = dict_numTileFaces( dict ); XP_U16 nFaces = dict_numTileFaces( dict );
Tile tile; Tile tile;
@ -160,7 +160,7 @@ dict_tileForString( DictionaryCtxt* dict, XP_UCHAR* key )
} /* dict_tileForChar */ } /* dict_tileForChar */
XP_Bool XP_Bool
dict_tilesAreSame( DictionaryCtxt* dict1, DictionaryCtxt* dict2 ) dict_tilesAreSame( const DictionaryCtxt* dict1, const DictionaryCtxt* dict2 )
{ {
XP_Bool result = XP_FALSE; XP_Bool result = XP_FALSE;
@ -355,7 +355,7 @@ dict_loadFromStream( DictionaryCtxt* dict, XWStreamCtxt* stream )
} /* dict_loadFromStream */ } /* dict_loadFromStream */
XP_UCHAR* XP_UCHAR*
dict_getName( DictionaryCtxt* dict ) dict_getName( const DictionaryCtxt* dict )
{ {
XP_ASSERT( !!dict ); XP_ASSERT( !!dict );
XP_ASSERT( !!dict->name ); XP_ASSERT( !!dict->name );
@ -363,14 +363,14 @@ dict_getName( DictionaryCtxt* dict )
} /* dict_getName */ } /* dict_getName */
XP_Bool XP_Bool
dict_faceIsBitmap( DictionaryCtxt* dict, Tile tile ) dict_faceIsBitmap( const DictionaryCtxt* dict, Tile tile )
{ {
XP_UCHAR face = dict_getTileChar( dict, tile ); XP_UCHAR face = dict_getTileChar( dict, tile );
return /* face != 0 && */IS_SPECIAL(face); return /* face != 0 && */IS_SPECIAL(face);
} /* dict_faceIsBitmap */ } /* dict_faceIsBitmap */
XP_Bitmap XP_Bitmap
dict_getFaceBitmap( DictionaryCtxt* dict, Tile tile, XP_Bool isLarge ) dict_getFaceBitmap( const DictionaryCtxt* dict, Tile tile, XP_Bool isLarge )
{ {
SpecialBitmaps* bitmaps; SpecialBitmaps* bitmaps;
XP_UCHAR face = dict_getTileChar( dict, tile ); XP_UCHAR face = dict_getTileChar( dict, tile );
@ -485,7 +485,7 @@ make_stubbed_dict( MPFORMAL_NOCOMMA )
#endif /* STUBBED_DICT */ #endif /* STUBBED_DICT */
static array_edge* static array_edge*
dict_super_edge_for_index( DictionaryCtxt* dict, XP_U32 index ) dict_super_edge_for_index( const DictionaryCtxt* dict, XP_U32 index )
{ {
array_edge* result; array_edge* result;
@ -510,7 +510,7 @@ dict_super_edge_for_index( DictionaryCtxt* dict, XP_U32 index )
} /* dict_edge_for_index */ } /* dict_edge_for_index */
static array_edge* static array_edge*
dict_super_getTopEdge( DictionaryCtxt* dict ) dict_super_getTopEdge( const DictionaryCtxt* dict )
{ {
return dict->topEdge; return dict->topEdge;
} /* dict_super_getTopEdge */ } /* dict_super_getTopEdge */

View file

@ -60,9 +60,9 @@ typedef struct SpecialBitmaps {
struct DictionaryCtxt { struct DictionaryCtxt {
void (*destructor)( DictionaryCtxt* dict ); void (*destructor)( DictionaryCtxt* dict );
array_edge* (*func_edge_for_index)( DictionaryCtxt* dict, XP_U32 index ); array_edge* (*func_edge_for_index)( const DictionaryCtxt* dict, XP_U32 index );
array_edge* (*func_dict_getTopEdge)( DictionaryCtxt* dict ); array_edge* (*func_dict_getTopEdge)( const DictionaryCtxt* dict );
XP_UCHAR* (*func_dict_getShortName)( DictionaryCtxt* dict ); XP_UCHAR* (*func_dict_getShortName)( const DictionaryCtxt* dict );
array_edge* topEdge; array_edge* topEdge;
array_edge* base; /* the physical beginning of the dictionary; not array_edge* base; /* the physical beginning of the dictionary; not
@ -123,7 +123,8 @@ struct DictionaryCtxt {
#define dict_getShortName(d) (*((d)->func_dict_getShortName))(d) #define dict_getShortName(d) (*((d)->func_dict_getShortName))(d)
XP_Bool dict_tilesAreSame( DictionaryCtxt* dict1, DictionaryCtxt* dict2 ); XP_Bool dict_tilesAreSame( const DictionaryCtxt* dict1,
const DictionaryCtxt* dict2 );
XP_Bool dict_hasBlankTile( const DictionaryCtxt* dict ); XP_Bool dict_hasBlankTile( const DictionaryCtxt* dict );
Tile dict_getBlankTile( const DictionaryCtxt* dict ); Tile dict_getBlankTile( const DictionaryCtxt* dict );
@ -131,14 +132,14 @@ XP_U16 dict_getTileValue( const DictionaryCtxt* ctxt, Tile tile );
XP_U16 dict_numTiles( const DictionaryCtxt* ctxt, Tile tile ); XP_U16 dict_numTiles( const DictionaryCtxt* ctxt, Tile tile );
XP_U16 dict_numTileFaces( const DictionaryCtxt* ctxt ); XP_U16 dict_numTileFaces( const DictionaryCtxt* ctxt );
XP_U16 dict_tilesToString( const DictionaryCtxt* ctxt, Tile* tiles, XP_U16 nTiles, XP_U16 dict_tilesToString( const DictionaryCtxt* ctxt, const Tile* tiles,
XP_UCHAR* buf, XP_U16 bufSize ); XP_U16 nTiles, XP_UCHAR* buf, XP_U16 bufSize );
XP_UCHAR* dict_getName( DictionaryCtxt* ctxt ); XP_UCHAR* dict_getName( const DictionaryCtxt* ctxt );
Tile dict_tileForString( DictionaryCtxt* dict, XP_UCHAR* key ); Tile dict_tileForString( const DictionaryCtxt* dict, const XP_UCHAR* key );
XP_Bool dict_faceIsBitmap( DictionaryCtxt* dict, Tile tile ); XP_Bool dict_faceIsBitmap( const DictionaryCtxt* dict, Tile tile );
XP_Bitmap dict_getFaceBitmap( DictionaryCtxt* dict, Tile tile, XP_Bitmap dict_getFaceBitmap( const DictionaryCtxt* dict, Tile tile,
XP_Bool isLarge ); XP_Bool isLarge );
#ifdef TALL_FONTS #ifdef TALL_FONTS