🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #5143

Re: Another delphi translation please!

#5143
From: Andrue Cope [TeamB]
Date: Mon, 26 Sep 2005 08:28
41 lines
1787 bytes
Yike :)

It would make life a little easier if you could un-nest the functions
for us and personally I'm not sure what:

  Int64(RomCode) := 0;

Is doing. Looks highly dubious but presumably TxRomCode is 4 bytes in
size.

Someone else might be willing to take it all on but for me on a Monday
morning that's all a bit much but I'll have a stab at a bit of it:

void SetSernumBit( int         value,
                   TxRomCode & RomCode, // Un-nesting
                   int         bitPos ) // Un-nesting
{
  int b=bitPos-1;

  int i=b/8;

  if( value )
    RomCode[ i ]=RomCode[ i ]|( 1<<( b%8 ) );
  else
    RomCode[ i ]=RomCode[ i ]&( !( 1<<( b%8 ) ) );
}

BYTE GetSernumBit( TxRomCode & RomCode, // Un-nesting
                   int         bitPos ) // Un-nesting
{
  int b=bitPos-1;

  int i=b/8;

  return RomCode[ i ]&( 1<<( b%8 ) );
}

-- 
Andrue Cope [TeamB]
[Bicester, Uk]
http://info.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <4337b0dd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <43370a81@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,6ea8b2c4d2578842
X-Google-Attributes: gid10cc67,public
X-Google-Language: ENGLISH,ASCII-7-bit
From: "Andrue Cope [TeamB]" <no.spam@not.a.valid.address>
Subject: Re: Another delphi translation please!
Newsgroups: borland.public.cppbuilder.nativeapi
References: <43370a81@newsgroups.borland.com>
Date: Mon, 26 Sep 2005 09:28:57 +0100
User-Agent: XanaNews/1.17.6.3
MIME-Version: 1.0
Content-Type: text/plain; charset=iso-8859-1
NNTP-Posting-Host: 217.207.223.34
Message-ID: <4337b0dd$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1127723229 217.207.223.34 (26 Sep 2005 01:27:09 -0700)
Lines: 41
X-Authenticated-User: acope
Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail