build fix, avoid use of 'class'
Build fix, avoid use of 'class' include\hack.h(199): error C2236: unexpected token 'class'. Did you forget a ';'? include\hack.h(199): error C2332: 'class': missing tag name include\hack.h(199): error C2027: use of undefined type 'sortloot_item::<unnamed-tag>'
This commit is contained in:
@@ -196,7 +196,7 @@ struct sortloot_item {
|
|||||||
char *str; /* result of loot_xname(obj) in some cases, otherwise null */
|
char *str; /* result of loot_xname(obj) in some cases, otherwise null */
|
||||||
int indx; /* signed int, because sortloot()'s qsort comparison routine
|
int indx; /* signed int, because sortloot()'s qsort comparison routine
|
||||||
assumes (a->indx - b->indx) might yield a negative result */
|
assumes (a->indx - b->indx) might yield a negative result */
|
||||||
xchar class; /* order rather than object class; 0 => not yet init'd */
|
xchar orderclass; /* order rather than object class; 0 => not yet init'd */
|
||||||
xchar subclass; /* subclass for some classes */
|
xchar subclass; /* subclass for some classes */
|
||||||
xchar disco; /* discovery status */
|
xchar disco; /* discovery status */
|
||||||
};
|
};
|
||||||
|
|||||||
14
src/invent.c
14
src/invent.c
@@ -81,7 +81,7 @@ struct obj *obj;
|
|||||||
k = 1 + (int) (p - classorder);
|
k = 1 + (int) (p - classorder);
|
||||||
else
|
else
|
||||||
k = 1 + (int) strlen(classorder) + (oclass != VENOM_CLASS);
|
k = 1 + (int) strlen(classorder) + (oclass != VENOM_CLASS);
|
||||||
sort_item->class = (xchar) k;
|
sort_item->orderclass = (xchar) k;
|
||||||
/* subclass designation; only a few classes have subclasses
|
/* subclass designation; only a few classes have subclasses
|
||||||
and the non-armor ones we use are fairly arbitrary */
|
and the non-armor ones we use are fairly arbitrary */
|
||||||
switch (oclass) {
|
switch (oclass) {
|
||||||
@@ -280,14 +280,14 @@ const genericptr vptr2;
|
|||||||
!= SORTLOOT_INVLET) {
|
!= SORTLOOT_INVLET) {
|
||||||
/* Classify each object at most once no matter how many
|
/* Classify each object at most once no matter how many
|
||||||
comparisons it is involved in. */
|
comparisons it is involved in. */
|
||||||
if (!sli1->class)
|
if (!sli1->orderclass)
|
||||||
loot_classify(sli1, obj1);
|
loot_classify(sli1, obj1);
|
||||||
if (!sli2->class)
|
if (!sli2->orderclass)
|
||||||
loot_classify(sli2, obj2);
|
loot_classify(sli2, obj2);
|
||||||
|
|
||||||
/* Sort by class. */
|
/* Sort by class. */
|
||||||
val1 = sli1->class;
|
val1 = sli1->orderclass;
|
||||||
val2 = sli2->class;
|
val2 = sli2->orderclass;
|
||||||
if (val1 != val2)
|
if (val1 != val2)
|
||||||
return (int) (val1 - val2);
|
return (int) (val1 - val2);
|
||||||
|
|
||||||
@@ -472,13 +472,13 @@ boolean FDECL((*filterfunc), (OBJ_P));
|
|||||||
continue;
|
continue;
|
||||||
sliarray[i].obj = o, sliarray[i].indx = (int) i;
|
sliarray[i].obj = o, sliarray[i].indx = (int) i;
|
||||||
sliarray[i].str = (char *) 0;
|
sliarray[i].str = (char *) 0;
|
||||||
sliarray[i].class = sliarray[i].subclass = sliarray[i].disco = 0;
|
sliarray[i].orderclass = sliarray[i].subclass = sliarray[i].disco = 0;
|
||||||
}
|
}
|
||||||
n = i;
|
n = i;
|
||||||
/* add a terminator so that we don't have to pass 'n' back to caller */
|
/* add a terminator so that we don't have to pass 'n' back to caller */
|
||||||
sliarray[n].obj = (struct obj *) 0, sliarray[n].indx = -1;
|
sliarray[n].obj = (struct obj *) 0, sliarray[n].indx = -1;
|
||||||
sliarray[n].str = (char *) 0;
|
sliarray[n].str = (char *) 0;
|
||||||
sliarray[n].class = sliarray[n].subclass = sliarray[n].disco = 0;
|
sliarray[n].orderclass = sliarray[n].subclass = sliarray[n].disco = 0;
|
||||||
|
|
||||||
/* do the sort; if no sorting is requested, we'll just return
|
/* do the sort; if no sorting is requested, we'll just return
|
||||||
a sortloot_item array reflecting the current ordering */
|
a sortloot_item array reflecting the current ordering */
|
||||||
|
|||||||
Reference in New Issue
Block a user