473,804 Members | 2,146 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 5695

"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
3640
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
4650
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
3057
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
3846
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
15648
by: vvv | last post by:
Hi All, Do we have anything in .NET which is equivalent to C++'s Typedef . Regards, Vasanth
6
7349
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
2576
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
4655
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
2792
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
9715
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
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10356
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
10099
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...
0
9176
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7643
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
5536
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...
0
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.