.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > General Bot Coding
General Bot Coding See what a pain it is to get those little mechs shooting around

Reply
 
Thread Tools
Question about far pointers
Old
  (#1)
Bert
Member
 
Status: Offline
Posts: 11
Join Date: Jan 2004
Default Question about far pointers - 16-06-2004

I've been using the (excellent) bot templates to write bots, but those templates lack a bit of structure. I really can't stand that procedural code (no offense) as I came from Java.
So I decided to start from scratch and only keep the stuff I really need.
I stumbled upon this code in bot.h

Code:
#ifndef __linux__

typedef int (FAR *GETENTITYAPI)(DLL_FUNCTIONS *, int);
typedef int (FAR *GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *);
typedef void (DLLEXPORT *GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *);
typedef int (DLLEXPORT *SERVER_GETBLENDINGINTERFACE) (int, struct sv_blending_interface_s **, struct engine_studio_api_s *, float (*)[3][4], float (*)[MAXSTUDIOBONES][3][4]);
typedef void (FAR *LINK_ENTITY_FUNC)(entvars_t *);

#else

#include <dlfcn.h>
#define GetProcAddress dlsym
typedef int BOOL;
typedef int (*GETENTITYAPI)(DLL_FUNCTIONS *, int);
typedef int (*GETNEWDLLFUNCTIONS)(NEW_DLL_FUNCTIONS *, int *);
typedef void (*GIVEFNPTRSTODLL)(enginefuncs_t *, globalvars_t *);
typedef int (*SERVER_GETBLENDINGINTERFACE) (int, struct sv_blending_interface_s **, struct engine_studio_api_s *, float (*)[3][4], float (*)[MAXSTUDIOBONES][3][4]);
typedef void (*LINK_ENTITY_FUNC)(entvars_t *);
#endif
I had no idea what that "FAR" keyword is, so after a bit of digging on the net I managed to piece together what it's supposed to be:
"The far qualifier when used in 16 bit compilers results in a 32 bit pointer."
So I assume I can safely remove that keyword, or does FAR have another more obscure significance aswell?
I'm not concerned with portability as I have no experience with other OSes besides Windows.
[MODS: I hope this is the right forum for this thread]
  
Reply With Quote
Re: Question about far pointers
Old
  (#2)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: Question about far pointers - 16-06-2004

Yes, I think you can remove "FAR" from the code. Botman could probably tell us more about this since it's his code (or does this part come straight from the HL SDK ? can't remember).



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: Question about far pointers
Old
  (#3)
@$3.1415rin
Council Member, Author of JoeBOT
 
@$3.1415rin's Avatar
 
Status: Offline
Posts: 1,381
Join Date: Nov 2003
Location: Germany
Default Re: Question about far pointers - 16-06-2004

in good ol times there was a different between near and far pointer, but on current pc systems there isnt ( well, internally, it still is ... ). near pointer were just in a segment, thus saving mem bandwidth and delays in the mem unit. today most stuff is plain 32 bit pointers, no more real use to use near etc.

maybe that's still a quake1 relict ... but lets wait for botman


  
Reply With Quote
Re: Question about far pointers
Old
  (#4)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: Question about far pointers - 17-06-2004

The 'FAR' in the above definitions satisfy the "CALLBACK" type on the GetProcAddress() function.

http://msdn.microsoft.com/library/de...rocaddress.asp

You can try to remove it and see if it compiles (but I'd be willing to bet that the C++ complier complains about a type conversion error).

botman
  
Reply With Quote
Re: Question about far pointers
Old
  (#5)
Bert
Member
 
Status: Offline
Posts: 11
Join Date: Jan 2004
Default Re: Question about far pointers - 17-06-2004

It compiles fine without the keyword, so I'll just leave it out. Thanks for the replies.
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com