--- sourceforge.net/trunk/rdesktop/cache.c 2004/06/29 16:22:41 730 +++ sourceforge.net/trunk/rdesktop/cache.c 2004/10/02 01:01:57 775 @@ -2,17 +2,17 @@ rdesktop: A Remote Desktop Protocol client. Cache routines Copyright (C) Matthew Chapman 1999-2002 - + 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., 675 Mass Ave, Cambridge, MA 02139, USA. @@ -25,10 +25,11 @@ #define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0) extern int g_pstcache_fd[]; +extern BOOL g_use_rdp5; uint32 g_stamp; -int g_num_bitmaps_in_memory[3]; +static int g_num_bitmaps_in_memory[3]; /* BITMAP CACHE */ static BMPCACHEENTRY g_bmpcache[3][0xa00]; @@ -40,7 +41,7 @@ { int i; uint16 cache_idx = 0; - uint32 m = (uint32)-1; + uint32 m = 0xffffffff; BMPCACHEENTRY *pbce; for (i = 0; i < NUM_ELEMENTS(g_bmpcache[cache_id]); i++) @@ -98,7 +99,7 @@ { ui_destroy_bitmap(old); } - else + else if (g_use_rdp5) { if (++g_num_bitmaps_in_memory[cache_id] > BMPCACHE2_C2_CELLS) cache_remove_lru_bitmap(cache_id);