/[rdesktop]/sourceforge.net/trunk/rdesktop/pstcache.c
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /sourceforge.net/trunk/rdesktop/pstcache.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 738 by astrand, Mon Jul 12 21:07:39 2004 UTC revision 808 by jdmeijer, Sat Dec 25 13:37:08 2004 UTC
# Line 22  Line 22 
22    
23  #define MAX_CELL_SIZE           0x1000  /* pixels */  #define MAX_CELL_SIZE           0x1000  /* pixels */
24    
25  #define IS_PERSISTENT(id) (g_pstcache_fd[id] > 0)  #define IS_PERSISTENT(id) (id < 8 && g_pstcache_fd[id] > 0)
26    
27  extern int g_server_bpp;  extern int g_server_bpp;
28  extern uint32 g_stamp;  extern uint32 g_stamp;
# Line 42  pstcache_touch_bitmap(uint8 cache_id, ui Line 42  pstcache_touch_bitmap(uint8 cache_id, ui
42  {  {
43          int fd;          int fd;
44    
45          if (!IS_PERSISTENT(cache_id))          if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
46                  return;                  return;
47    
48          fd = g_pstcache_fd[cache_id];          fd = g_pstcache_fd[cache_id];
# Line 59  pstcache_load_bitmap(uint8 cache_id, uin Line 59  pstcache_load_bitmap(uint8 cache_id, uin
59          CELLHEADER cellhdr;          CELLHEADER cellhdr;
60          HBITMAP bitmap;          HBITMAP bitmap;
61    
62          if (!(g_bitmap_cache_persist_enable && IS_PERSISTENT(cache_id)))          if (!g_bitmap_cache_persist_enable)
63                    return False;
64    
65            if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
66                  return False;                  return False;
67    
68          fd = g_pstcache_fd[cache_id];          fd = g_pstcache_fd[cache_id];
# Line 85  pstcache_put_bitmap(uint8 cache_id, uint Line 88  pstcache_put_bitmap(uint8 cache_id, uint
88          int fd;          int fd;
89          CELLHEADER cellhdr;          CELLHEADER cellhdr;
90    
91          if (!IS_PERSISTENT(cache_id))          if (!IS_PERSISTENT(cache_id) || cache_idx >= BMPCACHE2_NUM_PSTCELLS)
92                  return False;                  return False;
93    
94          memcpy(cellhdr.bitmap_id, bitmap_id, sizeof(BITMAP_ID));          memcpy(cellhdr.bitmap_id, bitmap_id, sizeof(BITMAP_ID));

Legend:
Removed from v.738  
changed lines
  Added in v.808

  ViewVC Help
Powered by ViewVC 1.1.26