14 Mar, 2010, yamtara wrote in the 1st comment:
Votes: 0
save.c: In function load_char_obj:
save.c:780: error: lvalue required as left operand of assignment
save.c: In function fread_char:
save.c:1239: error: lvalue required as left operand of assignment
save.c: In function fread_pet:
save.c:1535: error: lvalue required as left operand of assignment


whats wrong about this save.c
.
.

779 if (ORG_RACE(ch) == 0)
780 ORG_RACE(ch) = race_lookup("human");
781 if (RACE(ch) == 0)
782 RACE(ch) = race_lookup("human");
.
.
1237 {
1238 RACE(ch) = race_lookup(fread_string(fp));
1239 ORG_RACE(ch) = RACE(ch);
1240 fMatch = TRUE;
1241 break;
1242 }
.
.
.
1533 {
1534 RACE(pet) = race_lookup(fread_string(fp));
1535 ORG_RACE(pet) = RACE(pet);
1536 fMatch = TRUE;
1537 break;
1538 }
14 Mar, 2010, Runter wrote in the 2nd comment:
Votes: 0
Your macros expand to something that the compiler does not like. Post your macro defines for RACE and such else we can't really help you much.
14 Mar, 2010, yamtara wrote in the 3rd comment:
Votes: 0
#define RACE(ch) (ch->race)
#define ORG_RACE(ch) (IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race)


is this u are asking? orrr


/* race table */
#define RACE_NONE (ee - 1)
#define RACE_HUMAN (A)
#define RACE_ELF (B)
#define RACE_HALF_ELF (C)
#define RACE_DARK_ELF (D)
#define RACE_ROCKSEER (E) /* 5 */
#define RACE_DWARF (F)
#define RACE_SVIRFNEBLI (G)
#define RACE_DUERGAR (H)
#define RACE_ARIAL (I)
#define RACE_GNOME (J) /* 10 */
#define RACE_STORM_GIANT (K)
#define RACE_CLOUD_GIANT (L)
#define RACE_FIRE_GIANT (M)
#define RACE_FROST_GIANT (N)
#define RACE_FELAR (O) /* 15 */
#define RACE_GITHYANKI (P)
#define RACE_SATYR (Q)
#define RACE_TROLL (R)

#define RACE_TOP (T)
14 Mar, 2010, Runter wrote in the 4th comment:
Votes: 0
Not sure why exactly but it doesn't like this expansion..

#define ORG_RACE(ch) (IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race)


Expanding to…

(IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race) = race_lookup("human");


You could change those lines to

if (IS_NPC(ch))
ch->pIndexData->race = race_lookup("human");
else
ch->pcdata->race = race_lookup("human");


but I'm not totally sure why you'd need to.
14 Mar, 2010, Runter wrote in the 5th comment:
Votes: 0
Also might try:

#define ORG_RACE(ch) ((IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race))
14 Mar, 2010, David Haley wrote in the 6th comment:
Votes: 0
Runter said:
Not sure why exactly but it doesn't like this expansion..

#define ORG_RACE(ch) (IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race)


Expanding to…

(IS_NPC(ch) ? ch->pIndexData->race : ch->pcdata->race) = race_lookup("human");


You could change those lines to

if (IS_NPC(ch))
ch->pIndexData->race = race_lookup("human");
else
ch->pcdata->race = race_lookup("human");


but I'm not totally sure why you'd need to.

Because the conditional (a ? b : c) results in an expression result, not a place where you can assign variables (i.e., lvalue). You can't use it to assign to different things conditionally on the left-hand side; you can only use it to produce different expression results. Your later 'if' statement is what you would need to assign to a different place based on some condition.
14 Mar, 2010, Runter wrote in the 7th comment:
Votes: 0
But at one point that code must have been valid. He's trying to compile an old codebase that was (i'm assuming) distributed working.
14 Mar, 2010, David Haley wrote in the 8th comment:
Votes: 0
gcc used to be much more lax about what could be on the left-hand side of assignments; there's a common bug in SMAUG for example having to do with casting exits or something and new compilers getting unhappy. It's quite possible that they used to support that (incorrectly, be it deliberately or accidentally), and now have gotten stricter.
14 Mar, 2010, Runter wrote in the 9th comment:
Votes: 0
Little off topic but that type of macro use never appealed to me.
14 Mar, 2010, David Haley wrote in the 10th comment:
Votes: 0
I think that might be partly why they made it go away! :tongue: It's pretty nasty, I agree.
15 Mar, 2010, yamtara wrote in the 11th comment:
Votes: 0
http://sourceforge.net/projects/anatolia...

here is the code that i ame triying to combine gcc 4x. but it is too hard for me
any one can help me
15 Mar, 2010, Runter wrote in the 12th comment:
Votes: 0
yamtara said:
http://sourceforge.net/projects/anatolia...

here is the code that i ame triying to combine gcc 4x. but it is too hard for me
any one can help me


I don't understand. You're trying to get it to compile in gcc 4?
15 Mar, 2010, yamtara wrote in the 13th comment:
Votes: 0
i want to play this code in my own computer first ….
but this code write for gcc 3.x…..
my ubuntu 9.10 use gcc 4.x so there are too much error ,,, i have to correct them than i can play ..

sory for my english is not good enoug.

thanks for helping again and again
15 Mar, 2010, Runter wrote in the 14th comment:
Votes: 0
What is your native language?

Maybe you can just install gcc3?
15 Mar, 2010, yamtara wrote in the 15th comment:
Votes: 0
how can install gcc 3.x;
my ubuntu 9.10 use gcc 4.x. only :cry:


i ame speaking Turkish
15 Mar, 2010, David Haley wrote in the 16th comment:
Votes: 0
There should be a package called gcc3 (or maybe gcc3.4 or gcc3.3) in the package list.
15 Mar, 2010, yamtara wrote in the 17th comment:
Votes: 0
my ubuntu 9.10 using only gcc 4.x,,
:(
15 Mar, 2010, Runter wrote in the 18th comment:
Votes: 0
You could look for a code base that compiles in gcc4 without changes.
15 Mar, 2010, David Haley wrote in the 19th comment:
Votes: 0
Ah, it would appear that they got rid of it. I don't have it on my Ubuntu 9.10 either. You can try using gcc3 on Cygwin or AndLinux, under Windows, if you have those available. Or, install Debian or an older Ubuntu into a VM or something.


EDIT: Or…… what Runter said. Probably easier.
15 Mar, 2010, yamtara wrote in the 20th comment:
Votes: 0
can u give me a good code… for my gcc 4.x …
i want to play myself
and i can upgrate what ever i wand

new class new skill new area new social etc. easly

which mud u advice …
0.0/28