473,770 Members | 5,569 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

typedef

typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLAT EHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could
make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more
efficacious way to make this pass gcc with -ansi tag and no complaints? MPJ
Nov 14 '05 #1
15 5682

"Merrill & Michele" <be********@com cast.net> wrote in message
news:If******** ************@co mcast.com...
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLAT EHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could
make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more
efficacious way to make this pass gcc with -ansi tag and no complaints?

MPJ
typedef int WORD;

or

typedef unsigned int WORD;

Personally, i think of 'words' as unsigned, but i'm open to corrections.
Nov 14 '05 #2

"dandelion" <da*******@mead ow.net> wrote in message
news:41******** **************@ dreader15.news. xs4all.nl...

"Merrill & Michele" <be********@com cast.net> wrote in message
news:If******** ************@co mcast.com...
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLAT EHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more efficacious way to make this pass gcc with -ansi tag and no complaints?

MPJ
typedef int WORD;

or

typedef unsigned int WORD;

Personally, i think of 'words' as unsigned, but i'm open to corrections.


And where exactly do you put something like this so an OS can talk to ISO C
and vice versa. They teach different tools for hooking creatures like this
using Bjarne's paradigm. There has to be a way in C and my guess is that's
easy. MPJ
Nov 14 '05 #3

"dandelion" <da*******@mead ow.net> wrote in message
news:41******** **************@ dreader15.news. xs4all.nl...

"Merrill & Michele" <be********@com cast.net> wrote in message
news:If******** ************@co mcast.com...
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLAT EHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more efficacious way to make this pass gcc with -ansi tag and no complaints?

MPJ
typedef int WORD;

or

typedef unsigned int WORD;

Personally, i think of 'words' as unsigned, but i'm open to corrections.


Actually, this is probably what you are looking for:

typedef unsigned short WORD;
Nov 14 '05 #4
On Mon, 20 Dec 2004 08:31:03 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLA TEHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could
make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more
efficacious way to make this pass gcc with -ansi tag and no complaints? MPJ

The best way is to include the headers, presumably supplied by the
unnamed platform's implementation, which define WORD.

--
Al Balmer
Balmer Consulting
re************* ***********@att .net
Nov 14 '05 #5

"Alan Balmer" <al******@att.n et> wrote in message
news:l6******** *************** *********@4ax.c om...
On Mon, 20 Dec 2004 08:31:03 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLA TEHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could
make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, moreefficacious way to make this pass gcc with -ansi tag and no complaints? MPJ

The best way is to include the headers, presumably supplied by the
unnamed platform's implementation, which define WORD.


But those are going to include a lot of much less than standard stuff. But
if I get your meaning, I need to track down WORD. I MEANT to use an example
with a DWORD. Would that make a difference? MPJ
Nov 14 '05 #6

"Merrill & Michele" <be********@com cast.net> wrote in message
news:ZO******** ************@co mcast.com...

"Alan Balmer" <al******@att.n et> wrote in message
news:l6******** *************** *********@4ax.c om...
On Mon, 20 Dec 2004 08:31:03 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLA TEHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I couldmake this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, moreefficacious way to make this pass gcc with -ansi tag and no complaints? MPJ The best way is to include the headers, presumably supplied by the
unnamed platform's implementation, which define WORD.


But those are going to include a lot of much less than standard stuff.

But if I get your meaning, I need to track down WORD. I MEANT to use an example with a DWORD. Would that make a difference? MPJ


He's given you good advise. See windef.h
Nov 14 '05 #7
On Mon, 20 Dec 2004 12:05:38 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:

"Alan Balmer" <al******@att.n et> wrote in message
news:l6******* *************** **********@4ax. com...
On Mon, 20 Dec 2004 08:31:03 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:
>typedef struct
>{
> WORD versionNumber;
> WORD offset;
>}
>MENUITEMTEMPLA TEHEADER;
>
>This is from vol 5 of unnamed platform's programmer's reference. I could
>make this conforming by enclosing everything in a /*...*/ comment and
>appending the 'hail world' code. Is there an easier, and, let's say,more >efficacious way to make this pass gcc with -ansi tag and no complaints?MPJ >

The best way is to include the headers, presumably supplied by the
unnamed platform's implementation, which define WORD.


But those are going to include a lot of much less than standard stuff. But
if I get your meaning, I need to track down WORD. I MEANT to use an example
with a DWORD. Would that make a difference? MPJ

No. But what are you trying to accomplish? If you are trying to
actually compile a program on this platform, use the platform's
headers. If you're just trying to read the program, does the exact
definition of the type WORD really matter?

The above tells me that the author has invented a type named
MENUITEMTEMPLAT EHEADER (terrible name, imo, but that's another
subject.) This type is a struct composed of two variables,
versionNumber and offset. I see no reason, at this point, to care what
type those variables are. In fact, there should be no reason even to
know what type MENUITEMTEMPLAT EHEADER is composed of - it just gets
used when it's needed, and a good implementation would bury the
details where you don't need to see them, unless you are the author
that created it.

--
Al Balmer
Balmer Consulting
re************* ***********@att .net
Nov 14 '05 #8
Zax

"Alan Balmer" <al******@att.n et> wrote in message
news:m8******** *************** *********@4ax.c om...
On Mon, 20 Dec 2004 12:05:38 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:

"Alan Balmer" <al******@att.n et> wrote in message
news:l6******* *************** **********@4ax. com...
On Mon, 20 Dec 2004 08:31:03 -0600, "Merrill & Michele"
<be********@com cast.net> wrote:

>typedef struct
>{
> WORD versionNumber;
> WORD offset;
>}
>MENUITEMTEMPLA TEHEADER;
>
>This is from vol 5 of unnamed platform's programmer's reference. I could >make this conforming by enclosing everything in a /*...*/ comment and
>appending the 'hail world' code. Is there an easier, and, let's say,

more
>efficacious way to make this pass gcc with -ansi tag and no
complaints?MPJ
>
The best way is to include the headers, presumably supplied by the
unnamed platform's implementation, which define WORD.


But those are going to include a lot of much less than standard stuff. Butif I get your meaning, I need to track down WORD. I MEANT to use an examplewith a DWORD. Would that make a difference? MPJ

No. But what are you trying to accomplish? If you are trying to
actually compile a program on this platform, use the platform's
headers. If you're just trying to read the program, does the exact
definition of the type WORD really matter?

The above tells me that the author has invented a type named
MENUITEMTEMPLAT EHEADER (terrible name, imo, but that's another
subject.) This type is a struct composed of two variables,
versionNumber and offset. I see no reason, at this point, to care what
type those variables are. In fact, there should be no reason even to
know what type MENUITEMTEMPLAT EHEADER is composed of - it just gets
used when it's needed, and a good implementation would bury the
details where you don't need to see them, unless you are the author
that created it.


Believe it or not, MENUITEMTEMPLAT EHEADER is a creature that I think ISO C
can reach with sufficient elbow grease. I'm gonna look through some
headers. MPJ
Nov 14 '05 #9

"Bryan Bullard" <re****@to.grou p.com> wrote in message
news:lW******** *********@newss vr30.news.prodi gy.com...

"dandelion" <da*******@mead ow.net> wrote in message
news:41******** **************@ dreader15.news. xs4all.nl...

"Merrill & Michele" <be********@com cast.net> wrote in message
news:If******** ************@co mcast.com...
typedef struct
{
WORD versionNumber;
WORD offset;
}
MENUITEMTEMPLAT EHEADER;

This is from vol 5 of unnamed platform's programmer's reference. I could make this conforming by enclosing everything in a /*...*/ comment and
appending the 'hail world' code. Is there an easier, and, let's say, more efficacious way to make this pass gcc with -ansi tag and no
complaints? MPJ
typedef int WORD;

or

typedef unsigned int WORD;

Personally, i think of 'words' as unsigned, but i'm open to corrections.


Actually, this is probably what you are looking for:

typedef unsigned short WORD;


Maybe. Depends on the definition of a 'word'. On a 80x86 you are right,
on a Z80 you are wrong.
Nov 14 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3638
by: joe | last post by:
hi, after reading some articles and faq, i want to clarify myself what's correct(conform to standard) and what's not? or what should be correct but it isn't simply because compilers don't support. (first i compiled them with g++3.x. ERR means compiler will bark, otherwise it does accept it. Then the Comeau C/C++ 4.3.3 comes)
14
4649
by: dreamcatcher | last post by:
I always have this idea that typedef a data type especially a structure is very convenient in coding, but my teacher insisted that I should use the full struct declaration and no further explanations, so I wonder is there any good using typedef ? and I also know that when a data type being typedefed become an abstract data type, so what exactly is an abstract data type, is it any good ? -- Posted via http://dbforums.com
4
3055
by: Chris | last post by:
I've lurked around long enough... Time to interract =) I'm trying to make sense of the following. I can't quite wrap my head around what this is actually doing: ------------- typedef enum { DOUBLE_LIST, INT_LIST } DATA_TYPE; typedef struct { DATA_TYPE type;
16
3844
by: burn | last post by:
Hello, i am writing a program under linux in c and compile my code with make and gcc. Now i have 4 files: init.c/h and packets.c/h. Each header-file contains some: init.h: struct xyz {
12
15646
by: vvv | last post by:
Hi All, Do we have anything in .NET which is equivalent to C++'s Typedef . Regards, Vasanth
6
7347
by: Alex | last post by:
Hello people, I am getting errors from VS2003 when working with typedef'ed types. For example, assume that I have a type T, defined in a 3rd party include file based on some condition #if (condition) typedef char T; #else typedef short T;
15
2572
by: Ian Bush | last post by:
Hi All, I'm a bit confused by the following which is causing one of our user's codes fail in compilation: typedef struct SctpDest_S; 1) Is this standard ? 2) If so ( or even if not so ! ) what is it supposed to do ?
12
4654
by: Googy | last post by:
Hi!! Can any one explain me the meaning of following notations clearly : 1. typedef char(*(*frpapfrc()))(); frpapfrc f; 2. typedef int (*(arr2d_ptr)()); arr2d_ptr p; 3. typedef int (*(*(*ptr2d_fptr)()))();
16
2785
by: mdh | last post by:
A quick ? :-) question about Typedefs. There is a very brief discussion about this in K&R ( p146). Googling this group, there is a surprising dearth of questions about these. From one of the threads, there is sound advice ( to me at any rate) not to hide pointers behind typedefs. So, may I ask the group when the use of typedefs really makes sense? Sorry if this is somewhat general, but there are no exercises ( not that I am asking for...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9425
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
10005
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9871
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6679
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.