Login
User Name:

Password:



Register
Forgot your password?
Vote for Us!
auth_update crash
Dec 23, 2017, 10:15 pm
By Remcon
check_tumble
Dec 18, 2017, 7:21 pm
By Remcon
parse description bug
Dec 15, 2017, 10:08 pm
By Remcon
Couple bugs
Dec 12, 2017, 5:42 pm
By Remcon
Bug in disarm( )
Nov 12, 2017, 6:54 pm
By GatewaySysop
LoP 1.46
Author: Remcon
Submitted by: Remcon
LOP 1.45
Author: Remcon
Submitted by: Remcon
LOP Heroes Edition
Author: Vladaar
Submitted by: Vladaar
Heroes sound extras
Author: Vladaar
Submitted by: Vladaar
6Dragons 4.3
Author: Vladaar
Submitted by: Vladaar
Users Online
CommonCrawl, Yandex, Yahoo!, Bing

Members: 0
Guests: 10
Stats
Files
Topics
Posts
Members
Newest Member
478
3,708
19,242
612
Jacki72H
Today's Birthdays
Evoru (32)
Related Links
» SmaugMuds.org » General » Coding » Ubuntu Server
Forum Rules | Mark all | Recent Posts

Ubuntu Server
< Newer Topic :: Older Topic >

Pages:<< prev 1 next >>
Post is unread #1 Oct 13, 2009, 12:47 pm
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts144
JoinedJan 24, 2008

I'm finally getting around to setting up my Ubuntu server. I have been working on another shell for the last bit but decided just to set up my machine to do it. However, I'm not extremely familiar with setting up servers. I took my version of SWRFUSS (only thing changed are several flags are converted to extended bitvectors). However, when I go to 'make' I get the following error:
mud.h:1641: error: 'typedef' was ignored in this declaration


The block in question is:
typedef enum
{
 ROOM_DARK, ROOM_R1, ROOM_NO_MOB, ROOM_INDOORS, ROOM_CAN_LAND, ROOM_CAN_FLY,
 ROOM_NO_DRIVING, ROOM_NO_MAGIC, ROOM_BANK, ROOM_PRIVATE, ROOM_SAFE, ROOM_SOLITARY, 
 ROOM_PET_SHOP, ROOM_NO_RECALL, ROOM_DONATION, ROOM_NODROPALL, ROOM_SILENCE,
 ROOM_LOGSPEECH, ROOM_NODROP, ROOM_CLANSTOREROOM, ROOM_PLR_HOME, ROOM_EMPTY_HOME, 
 ROOM_TELEPORT, ROOM_HOTEL, ROOM_NOFLOOR, ROOM_REFINERY, ROOM_FACTORY, ROOM_E_RECRUIT, ROOM_R_RECRUIT, ROOM_SPACECRAFT, ROOM_PROTOTYPE, ROOM_AUCTION, ROOM_MAX
}; --- this line here


Anyone know what I am missing?
       
Post is unread #2 Oct 13, 2009, 12:49 pm
Go to the top of the page
Go to the bottom of the page

Keirath
Magician
GroupMembers
Posts144
JoinedJan 24, 2008

Nevermind. I'm a moron. Saw what I missed.
       
Post is unread #3 Oct 13, 2009, 1:06 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

For the benefit of others, what was it you missed?
       
Post is unread #4 Oct 13, 2009, 1:13 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

There's a typedef, with a type to give an alias for, but no alias given.
       
Post is unread #5 Oct 13, 2009, 1:52 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Is the alias the piece that's usually where his italics part would be? The names usually found there? I never knew those actually had meaning since I'd never seen them directly referenced.
       
Post is unread #6 Oct 13, 2009, 2:06 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

Yes:
typedef a b;
means that 'b' is now an alias for 'a'.

E.g.,
typedef unsigned char uchar;

uchar c; // <-- declare an unsigned char less verbosely


or,

typedef std::vector<std::string> StringVector;

StringVector v; // ahh, that's easier to type :-)


But a typedef without an alias is a kind of weird thing to write (it doesn't really do anything), which is probably why the compiler is complaining.
It's basically saying: "Here is an anonymous enum, that shall have the name, err... anonymous" :smile:
       
Post is unread #7 Oct 13, 2009, 2:14 pm
Go to the top of the page
Go to the bottom of the page

Samson
Black Hand
GroupAdministrators
Posts3,639
JoinedJan 1, 2002

Those, yes, I knew what those did and why they worked. I meant with the enums. I never really knew that the enum names actually meant anything because I don't recall ever seeing code that referenced the name of the enum directly like that.
       
Post is unread #8 Oct 13, 2009, 2:35 pm
Go to the top of the page
Go to the bottom of the page

David Haley
Sorcerer
GroupMembers
Posts903
JoinedJan 29, 2007

A common trick in C is to give enums names, much like for structs, to make the syntax easier to deal with.

E.g.,

struct my_struct { /* ... */ };

then, to use this, you must do:

struct my_struct s; // declare 's' as type struct my_struct

so people often do:

typedef struct my_struct { /* ... */ } MY_STRUCT;

so that they can do:

MY_STRUCT s;

It's basically the same thing with enums. If you want to declare a variable of an enumeral type, you need to write out the whole type (enum room_type), or you typedef the whole enum to a new name (ROOM_TYPE) -- or whatever name you like.

C++ did away with this, incidentally, so that if you write struct my_struct, you can declare things straight away as my_struct.
       
Pages:<< prev 1 next >>