Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 155617 | Differences between
and this patch

Collapse All | Expand All

(-)abuse_sdl-0.7.0.orig/src/include/stack.hpp (-5 / +23 lines)
Lines 13-32 Link Here
13
{ 
13
{ 
14
  public :
14
  public :
15
  T **sdata;
15
  T **sdata;
16
  long son;
16
  unsigned int son, _max_size;
17
17
  /* <sigh> the max_size parameter is the number of bytes of the pointerstack
18
  grow_stack(int max_size) { sdata=(T **)jmalloc(max_size,"pointer stack");  son=0; }
18
     instead of the number of entries which it ofcourse should have been.
19
     This breaks on 64 bit since the caller assumes 4 bytes per pointer and
20
     thus on 64 bit allocates not enough memory. Instead of fixing all callers
21
     we work around this by multiplying maxsize by 2 on 64 bit. */
22
  grow_stack(unsigned int max_size)
23
  { 
24
    max_size *= sizeof(void*)/sizeof(int);
25
    sdata = (T **)jmalloc(max_size, "pointer stack");
26
    son=0;
27
    _max_size=max_size;
28
  }
29
  
19
  void push(T *data) 
30
  void push(T *data) 
20
  {
31
  {
21
    sdata[son]=data;
32
    sdata[son]=data;
22
    son++;
33
    son++;
34
    if (son >= (_max_size/sizeof(int)))
35
    {
36
      lbreak("stack overflow\n");
37
      exit(0);
38
    }
23
  }
39
  }
24
   
40
   
25
  T *pop(long total) 
41
  T *pop(unsigned int total) 
26
  { if (total>son) { lbreak("stack underflow\n"); exit(0); }
42
  {
43
    if (total>son) { lbreak("stack underflow\n"); exit(0); }
27
    son-=total;
44
    son-=total;
28
    return sdata[son];
45
    return sdata[son];
29
  }
46
  }
47
30
  void clean_up() 
48
  void clean_up() 
31
  { 
49
  { 
32
    if (son!=0) fprintf(stderr,"Warning cleaning up stack and not empty\n");
50
    if (son!=0) fprintf(stderr,"Warning cleaning up stack and not empty\n");
(-)abuse_sdl-0.7.0.orig/src/light.cpp (-1 / +1 lines)
Lines 348-354 Link Here
348
//      f->write(green_light,256*64);
348
//      f->write(green_light,256*64);
349
			for (int i=0;i<TTINTS;i++)
349
			for (int i=0;i<TTINTS;i++)
350
				f->write(tints[i],256);
350
				f->write(tints[i],256);
351
			fp->write(bright_tint,256);
351
			f->write(bright_tint,256);
352
//    f.write(trans_table,256*256);
352
//    f.write(trans_table,256*256);
353
		}
353
		}
354
		delete f;
354
		delete f;

Return to bug 155617