'{' : missing function header (old-style formal list?)

Pages: 12
1
2
3
4
5
6
Compiling...
cg_syscall.cpp
.\cg_syscall.cpp(18) : error C2447: '{' : missing function header (old-style formal list?)
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



cg_syscall.cpp

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#include "main.h"

int (QDECL *psyscall)(int cmd, ...);
int QDECL osyscall(int cmd, ...)
{
	
	 LPVOID arg[10];
	 va_list arglist;
	 va_start( arglist, cmd );
	 for( int i = 9, j = 0; i > 0; i-- )
		 arg[j++] = va_arg( arglist, LPVOID );
	 va_end( arglist );

	refEntity_t * re = (refEntity_t *)arg[0];

	bool isvisible (float *pos)
; }
{ 
 
	if(cgs.clientinfo[re->entityNum].team != cgs.clientinfo[cg.clientNum].enemy)
             {
                    if(!isvisible(cg_entities[re->entityNum].lerpOrgin))
                    {
                    re->customShader = 14;
                    }
                   else  
                   {
                  re->customShader = 8;
                  }
              
 }
              else if(cgs.clientinfo[re->entityNum].team )            
             {
            
              re->customShader = 16;

             }

	 switch(cmd) 
	 {
	 case CG_R_ADDREFENTITYTOSCENE: 
			if(re->frame)
			{
				re->renderfx |= RF_DEPTHHACK; 

			}
		 break; 
	 }

	 return psyscall(cmd, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7], arg[8], arg[9]); //return the original
}
At lines 17-18 you should remove the braces
^Then i get more errors.

1
2
3
4
5
6
7
8
9
10
Compiling...
cg_syscall.cpp
.\cg_syscall.cpp(19) : error C2143: syntax error : missing ';' before 'if'
.\cg_syscall.cpp(19) : error C2039: 'enemy' : is not a member of 'clientInfo_s'
        c:\documents and settings\administrator jeroen\bureaublad\hook\Engine/cg_local.h(503) : see declaration of 'clientInfo_s'
.\cg_syscall.cpp(21) : error C2039: 'lerpOrgin' : is not a member of 'centity_s'
        c:\documents and settings\administrator jeroen\bureaublad\hook\Engine/cg_local.h(268) : see declaration of 'centity_s'
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include "main.h"

int (QDECL *psyscall)(int cmd, ...);
int QDECL osyscall(int cmd, ...)
{
	
	 LPVOID arg[10];
	 va_list arglist;
	 va_start( arglist, cmd );
	 for( int i = 9, j = 0; i > 0; i-- )
		 arg[j++] = va_arg( arglist, LPVOID );
	 va_end( arglist );

	refEntity_t * re = (refEntity_t *)arg[0];

	bool isvisible (float *pos)


	if(cgs.clientinfo[re->entityNum].team != cgs.clientinfo[cg.clientNum].enemy)
             {
                    if(!isvisible(cg_entities[re->entityNum].lerpOrgin))
                    {
                    re->customShader = 14;
                    }
                   else  
                   {
                  re->customShader = 8;
                  }
              
 }
              else if(cgs.clientinfo[re->entityNum].team )            
             {
            
              re->customShader = 16;

             }

	 switch(cmd) 
	 {
	 case CG_R_ADDREFENTITYTOSCENE: 
			if(re->frame)
			{
				re->renderfx |= RF_DEPTHHACK; 

			}
		 break; 
	 }

	 return psyscall(cmd, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7], arg[8], arg[9]); //return the original
}
You have removed the semicolon (which should be at the end of line 16)
And what do you mean by that :S.

} bool isvisible (float *pos)

Like that ?
Uh, I didn't noticed that it was a function declaration.
So it should be like this:
1
2
3
4
5
6
7
8
9
int QDECL osyscall(int cmd, ...)
{
    //...
    // (You are not returning a value)
}
bool isvisible (float *pos)
{
   //...
}



You should change the indentation of your code to make it more readable
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "main.h"

int (QDECL *psyscall)(int cmd, ...);
int QDECL osyscall(int cmd, ...)
{
	
	 LPVOID arg[10];
	 va_list arglist;
	 va_start( arglist, cmd );
	 for( int i = 9, j = 0; i > 0; i-- )
		 arg[j++] = va_arg( arglist, LPVOID );
	 va_end( arglist );

	refEntity_t * re = (refEntity_t *)arg[0];
}
	bool isvisible (float *pos) 
	{
;	if(cgs.clientinfo[re->entityNum].team != cgs.clientinfo[cg.clientNum].enemy)
	}
                    if(!isvisible(cg_entities[re->entityNum].lerpOrgin))
                    {
                    re->customShader = 14;
                    }
                   else  
                   {
                  re->customShader = 8;
                  }
              
 }
              else if(cgs.clientinfo[re->entityNum].team )            
             {
            
              re->customShader = 16;

             }

	 switch(cmd) 
	 {
	 case CG_R_ADDREFENTITYTOSCENE: 
			if(re->frame)
			{
				re->renderfx |= RF_DEPTHHACK; 

			}
		 break; 
	 }

	 return psyscall(cmd, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7], arg[8], arg[9]); //return the original
}



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
Compiling...
cg_syscall.cpp
.\cg_syscall.cpp(18) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(18) : error C2227: left of '->entityNum' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(18) : error C2228: left of '.team' must have class/struct/union
.\cg_syscall.cpp(18) : error C2039: 'enemy' : is not a member of 'clientInfo_s'
        c:\documents and settings\administrator jeroen\bureaublad\hook\Engine/cg_local.h(503) : see declaration of 'clientInfo_s'
.\cg_syscall.cpp(19) : error C2143: syntax error : missing ';' before '}'
.\cg_syscall.cpp(19) : warning C4390: ';' : empty controlled statement found; is this the intent?
.\cg_syscall.cpp(20) : error C2059: syntax error : 'if'
.\cg_syscall.cpp(21) : error C2143: syntax error : missing ';' before '{'
.\cg_syscall.cpp(21) : error C2447: '{' : missing function header (old-style formal list?)
.\cg_syscall.cpp(24) : error C2059: syntax error : 'else'
.\cg_syscall.cpp(25) : error C2143: syntax error : missing ';' before '{'
.\cg_syscall.cpp(25) : error C2447: '{' : missing function header (old-style formal list?)
.\cg_syscall.cpp(29) : error C2059: syntax error : '}'
.\cg_syscall.cpp(29) : error C2143: syntax error : missing ';' before '}'
.\cg_syscall.cpp(29) : error C2059: syntax error : '}'
.\cg_syscall.cpp(31) : error C2143: syntax error : missing ';' before '{'
.\cg_syscall.cpp(31) : error C2447: '{' : missing function header (old-style formal list?)
.\cg_syscall.cpp(37) : error C2059: syntax error : 'switch'
.\cg_syscall.cpp(38) : error C2143: syntax error : missing ';' before '{'
.\cg_syscall.cpp(38) : error C2447: '{' : missing function header (old-style formal list?)
.\cg_syscall.cpp(48) : error C2059: syntax error : 'return'
.\cg_syscall.cpp(49) : error C2059: syntax error : '}'
.\cg_syscall.cpp(49) : error C2143: syntax error : missing ';' before '}'
.\cg_syscall.cpp(49) : error C2059: syntax error : '}'
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 23 error(s), 1 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Your indentation is very messy,
at line 18 you have an extra semicolon, at line 19 the '{' should be an '}'
Last edited on
It was alreaddy a } :/
Yes, sorry. I typed the opposite of what I meant
It should be a '{'
Now i got 33 errors .. pff. It just dosnt stop.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
Compiling...
cg_syscall.cpp
.\cg_syscall.cpp(18) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(18) : error C2227: left of '->entityNum' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(18) : error C2228: left of '.team' must have class/struct/union
.\cg_syscall.cpp(18) : error C2039: 'enemy' : is not a member of 'clientInfo_s'
        c:\documents and settings\administrator jeroen\bureaublad\hook\Engine/cg_local.h(503) : see declaration of 'clientInfo_s'
.\cg_syscall.cpp(20) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(20) : error C2227: left of '->entityNum' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(20) : error C2228: left of '.lerpOrgin' must have class/struct/union
.\cg_syscall.cpp(22) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(22) : error C2227: left of '->customShader' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(26) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(26) : error C2227: left of '->customShader' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(30) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(30) : error C2227: left of '->entityNum' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(30) : error C2228: left of '.team' must have class/struct/union
.\cg_syscall.cpp(33) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(33) : error C2227: left of '->customShader' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(37) : error C2065: 'cmd' : undeclared identifier
.\cg_syscall.cpp(37) : error C2050: switch expression not integral
.\cg_syscall.cpp(40) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(40) : error C2227: left of '->frame' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(42) : error C2065: 're' : undeclared identifier
.\cg_syscall.cpp(42) : error C2227: left of '->renderfx' must point to class/struct/union/generic type
        type is ''unknown-type''
.\cg_syscall.cpp(48) : error C2065: 'cmd' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
.\cg_syscall.cpp(48) : error C2065: 'arg' : undeclared identifier
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 33 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
It doesn't recognize refEntity_t as a valid type
and should be osyscall and isvisible different functions?
why did you type bool isvisible (float *pos) ?
try removing from line 16 to 18 from the code you had on your first post
1
2
3
4
5
6
7
8
Compiling...
cg_syscall.cpp
.\cg_syscall.cpp(16) : error C2039: 'enemy' : is not a member of 'clientInfo_s'
        c:\documents and settings\administrator jeroen\bureaublad\hook\Engine/cg_local.h(503) : see declaration of 'clientInfo_s'
.\cg_syscall.cpp(18) : error C3861: 'isvisible': identifier not found
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 2 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


The code is now

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "main.h"

int (QDECL *psyscall)(int cmd, ...);
int QDECL osyscall(int cmd, ...)
{
	
	 LPVOID arg[10];
	 va_list arglist;
	 va_start( arglist, cmd );
	 for( int i = 9, j = 0; i > 0; i-- )
		 arg[j++] = va_arg( arglist, LPVOID );
	 va_end( arglist );

	refEntity_t * re = (refEntity_t *)arg[0];
	
;	if(cgs.clientinfo[re->entityNum].team != cgs.clientinfo[cg.clientNum].enemy)
{
                    if(!isvisible(cg_entities[re->entityNum].lerpOrgin))
                    {
                    re->customShader = 14;
                    }
                   else  
                   {
                  re->customShader = 8;
                  }
              
 }
              else if(cgs.clientinfo[re->entityNum].team )            
             {
            
              re->customShader = 16;

             }

	 switch(cmd) 
	 {
	 case CG_R_ADDREFENTITYTOSCENE: 
			if(re->frame)
			{
				re->renderfx |= RF_DEPTHHACK; 

			}
		 break; 
	 }

	 return psyscall(cmd, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7], arg[8], arg[9]); //return the original
}
Last edited on
1 error left.

cg_syscall.cpp
.\cg_syscall.cpp(18) : error C3861: 'isvisible': identifier not found
Build log was saved at "file://c:\Documents and Settings\Administrator Jeroen\Bureaublad\Hook\Release\BuildLog.htm"
ET_Hook - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
You should define isvisible somewhere

eg:

1
2
3
4
5
6
7
8
bool isvisible (float *pos)
{
   //...
}
int QDECL osyscall(int cmd, ...)
{
   //...
}
.\cg_syscall.cpp(5) : error C2199: syntax error : found 'int (' at global scope (was a declaration intended?)
Nobody ?
Check the declaration of psyscall
( int (QDECL *psyscall)(int cmd, ...); )
i got this in CG_syscall

1
2
return psyscall(cmd, arg[0], arg[1], arg[2], arg[3], arg[4], arg[5], arg[6], arg[7], arg[8], arg[9]); //return the original
}
?

In my main.h

extern int (QDECL *psyscall)(int cmd, ...);

main.cpp

psyscall = syscallptr;
Last edited on
If this isnt it. Then i dont got a declaration.
Pages: 12