[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MiNT] cookie jar



Hello,
don't blame each other ;) 
The problem is: We don't have enough time / people to fix all the
problems. Isn't it that way? I believe there must be an problem
somewhere, of course it's wrong to just blame freemint... especially if
there is enough room for cookies left! BubbleGEM is OpenSource and maybe
Peter can dig into it:
http://www.ataricq.org/attachments/196_bgem_src.zip
and look when the message alert shows up? The source isn't that
much..., some debug logging maybe brings light into the dark :) 

This is the source line:
if not(NewCookie('BGEM',longint(bgem))) then
form_alert(1,'[1][(BubbleGEM:)|Der CookieJar ist voll. |Konnte
BGEM-Cookie nicht anlegen. ][  OK  ]');

These are the cookie related functions:

function GetCookieJar: PCookie;

	begin
		GetCookieJar:=PCookie(setexc(360,pointer(-1)))
	end;


function GetCookie(cookie: TCookieID; var wert: longint): boolean;
  var cookiejar: PCookie;

  begin
  	GetCookie:=false;
    cookiejar:=GetCookieJar;
    if cookiejar<>nil then
			while PLongint(cookiejar)^<>0 do
				with cookiejar^ do
					if ID=cookie then
						begin
							wert:=Value;
							GetCookie:=true;
							exit
						end
					else
						inc(longint(cookiejar),8);
  end;

function NewCookie(cookie: TCookieID; wert: longint): boolean;
	var cookiejar: PCookie;
	    anz,maxc : longint;

	begin
		NewCookie:=false;
		cookiejar:=GetCookieJar;
		if cookiejar<>nil then
			begin
				anz:=1;
				while PLongint(cookiejar)^<>0 do
					begin
						inc(longint(cookiejar),8);
						inc(anz)
					end;
				maxc:=cookiejar^.Value;
				if anz<maxc then
					begin
						with cookiejar^ do
							begin
								ID:=cookie;
								Value:=wert
							end;
						inc(longint(cookiejar),8);
						with cookiejar^ do
							begin
								ID:=#0#0#0#0;
								Value:=maxc
							end;
						NewCookie:=true
					end
			end
	end;

Greets,
m