function.c:1085:12: error: lvalue required as left operand of assignment
Hello.. i'm trying to compile an energymech(emech-2.9.3) and i don't know why do i get this error all the time at any versions .. please help me.
root@xxl:~/emech-2.9.3$ make clean mech install
( cd src ; make clean )
make[1]: Entering directory `/home/root/emech-2.9.3/src'
/bin/rm -f cfgfile.o channel.o com-ons.o combot.o commands.o dcc.o debug.o function.o link.o main.o parse.o socket.o userlist.o vars.o xmech.o trivia.o gencmd mcmd.h core
make[1]: Leaving directory `/home/root/emech-2.9.3/src'
( cd src ; make mech )
make[1]: Entering directory `/home/root/emech-2.9.3/src'
/usr/bin/gcc -g -o gencmd gencmd.c
./gencmd > mcmd.h
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c cfgfile.c
cfgfile.c: In function 'cfg_addhandle':
cfgfile.c:455:2: warning: value computed is not used [-Wunused-value]
cfgfile.c: In function 'cfg_addks':
cfgfile.c:605:2: warning: value computed is not used [-Wunused-value]
cfgfile.c: In function 'cfg_add........':
cfgfile.c:622:2: warning: value computed is not used [-Wunused-value]
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c channel.c
channel.c: In function 'channel_massmode':
channel.c:1041:10: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
channel.c:1052:8: warning: ignoring return value of 'write', declared with attribute warn_unused_result [-Wunused-result]
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c com-ons.c
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c combot.c
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c commands.c
commands.c: In function 'do_spymsg':
commands.c:1447:2: warning: value computed is not used [-Wunused-value]
commands.c: In function 'do_statmsg':
commands.c:1469:2: warning: value computed is not used [-Wunused-value]
commands.c: In function 'do_spy':
commands.c:1669:2: warning: value computed is not used [-Wunused-value]
commands.c: In function 'do_kicksay':
commands.c:2075:2: warning: value computed is not used [-Wunused-value]
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c dcc.c
dcc.c: In function 'process_incoming_chat':
dcc.c:114:3: warning: pointer targets in passing argument 3 of 'accept' differ in signedness [-Wpointer-sign]
/usr/include/x86_64-linux-gnu/sys/socket.h:214:12: note: expected 'socklen_t * __restrict__' but argument is of type 'int *'
dcc.c: In function 'dcc_chat':
dcc.c:331:2: warning: pointer targets in passing argument 3 of 'getsockname' differ in signedness [-Wpointer-sign]
/usr/include/x86_64-linux-gnu/sys/socket.h:119:12: note: expected 'socklen_t * __restrict__' but argument is of type 'int *'
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c debug.c
/usr/bin/gcc -pipe -g -Wshadow -Wall -O2 -c function.c
function.c: In function 'cipher':
function.c:1021:6: warning: pointer targets in assignment differ in signedness [-Wpointer-sign]
function.c: In function 'findstruct':
function.c:1085:12: error: lvalue required as left operand of assignment
function.c: In function 'addstruct':
function.c:1114:13: error: lvalue required as left operand of assignment
make[1]: *** [function.o] Error 1
make[1]: Leaving directory `/home/root/emech-2.9.3/src'
make: *** [mech] Error 2
root@xxl:~/emech-2.9.3$
this is in the function.c
Code:
#define CIPHER(a1,a2,a3,a4,b1,b2,b3,b4) \
{ \
a2 = a2 ^ a1; \
b2 = b2 ^ b1; \
a3 = a2 ^ a1; \
b3 = b2 ^ b1; \
b3 >>= 2; \
b3 |= ((a3 & 3) << 30); \
a3 >>= 2; \
a2 = a3 ^ a2; \
b2 = b3 ^ b2; \
a4 = ~a4 ^ a2; \
b4 = -b4 ^ b2; \
a2 = a4 ^ ~a2; \
b2 = b4 ^ -b2; \
b1 >>= 1; \
b1 |= ((a1 & 1) << 31); \
a1 >>= 1; \
}
char *cipher(char *arg)
{
static char res[40];
Ulong B1a,B2a,B3a,B4a;
Ulong B1b,B2b,B3b,B4b;
Uchar *ptr;
Ulong R1;
int i;
if (!arg || !*arg)
return(NULL);
B1a = B2a = B3a = B4a = 0;
B1b = B2b = B3b = B4b = 0;
ptr = arg;
while(*ptr)
{
R1 = *ptr;
for(i=0;i<8;i++)
{
if (R1 & 1)
{
B1a |= 0x80008000;
B1b |= 0x80008000;
}
R1 >>= 1;
CIPHER(B1a,B2a,B3a,B4a,B1b,B2b,B3b,B4b);
}
ptr++;
}
while((B1a) || (B1b))
{
CIPHER(B1a,B2a,B3a,B4a,B1b,B2b,B3b,B4b);
}
memset(res,0,sizeof(res));
i = 0;
for(i=0;i<10;i++)
{
res[i] = pctab[(B4b & 0x3f)];
B4b >>= 6;
B4b |= ((B4a & 0x3f) << 26);
B4a >>= 6;
}
return(res);
}
void makepass(char *encoded, char *plain)
{
strcpy(encoded,cipher(plain));
}
int passmatch(char *plain, char *encoded)
{
return(!Strcasecmp(cipher(plain),encoded));
}
int check_for_number(char *from, char *string)
{
if (!string || !isdigit((int)*string))
{
send_to_user(from, TEXT_EXPECTNUM);
return 1;
}
return 0;
}
char *findstruct(char *base, int num, int sz, int ident)
{
MLStub *s;
int i;
s = (MLStub*)base;
for(i=0;i<num;i++)
{
if ((s->used) && (s->ident == ident))
return((char*)s);
(char*)s += sz;
}
return(NULL);
}
char *addstruct(char **base, char *new, int *num, int sz)
{
char *pt;
int i;
if (*base == NULL)
{
set_mallocdoer(addstruct);
pt = (char*)MyMalloc(sz);
memcpy(pt,new,sz);
*base = pt;
*num = 1;
return(pt);
}
loop:
pt = *base;
for(i=0;i<*num;i++)
{
if (*pt == 0)
{
memcpy(pt,new,sz);
return(pt);
}
(void*)pt += sz;
}
set_mallocdoer(addstruct);
pt = (char*)MyMalloc(sz * (*num+1));
if (!pt)
mechexit(1);
memcpy(pt,*base,((*num) * sz));
MyFree((char**)base);
*base = pt;
(*num)++;
goto loop;
}