compile errors

closed account (ypE3T05o)
When i go to compile my code
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
/**NOTES//!
==
MY NOTES
==
*/

const char *FS_ReferencedPakPureChecksums( void ) {
	static char	info[BIG_INFO_STRING];
	searchpath_t	*search;
	int numPaks, checksum;

	info[0] = 0;

    //! My Notes
//    int z = 0;
//    int y = 0;
//    int firsttime;

	checksum = fs_checksumFeed;

	Com_DPrintf("\n\n\n\n\nchecksum feed is '%d'\n", fs_checksumFeed);
	numPaks = 0; //My Notes

  char checksum1[BIG_INFO_STRING];
  char checksum2[BIG_INFO_STRING];
  int times = 0;
  for ( search = fs_searchpaths ; search; search = search->next )
  {
     if ( search->pack && strcmp(search->pack->pakGamename, "MN") )
     {
     if (times == 0)
     {
     strcpy(checksum1, va("%i ", search->pack->pure_checksum ));
     Com_DPrintf("checksum1 coming from %s\n\n", search->pack->pakFilename);
     checksum ^= search->pack->pure_checksum;
     }
     if (times == 1)
     {
     strcpy(checksum2, va("%i ", search->pack->pure_checksum ));
     Com_DPrintf("checksum2 coming from %s\n\n", search->pack->pakFilename );
     checksum ^= search->pack->pure_checksum;
     }
     times++;
     }
     else
     {
     if (search->pack)
    Com_DPrintf("search->pack->Filename %s dropped\n", search->pack->pakFilename );
     }
  }
  Com_DPrintf( "info %s\n", info );
  strcat( info, checksum2 );
  Com_DPrintf( "info %s\n", info );
  strcat( info, checksum2 );
  Com_DPrintf( "info %s\n", info );
  info[strlen(info)+1] = '\0';
    Com_DPrintf( "info %s\n", info );
  info[strlen(info)+2] = '\0';
    Com_DPrintf( "info %s\n", info );
  info[strlen(info)] = '@';
    Com_DPrintf( "info %s\n", info );
  info[strlen(info)] = ' ';
    Com_DPrintf( "info %s\n", info );
  strcat( info, checksum1 );
    Com_DPrintf( "info %s\n", info );
  strcat( info, checksum2 );
    Com_DPrintf( "info %s\n", info );

	numPaks = 2;
	// My Notes
	checksum ^= numPaks;
	Q_strcat( info, sizeof( info ), va("%i ", checksum ) );
    Com_DPrintf("the string from client to server of pure packs is\n%s\n\n\n\n\n", info);

    fflush(NULL);
	return info;
}

I get some compile errors.
1
2
3
4
5
6
7
8
9
10
11
12
..\..\(25) : error C2143: syntax error : missing ';' before 'type'
..\..\(26) : error C2143: syntax error : missing ';' before 'type'
..\..\(27) : error C2143: syntax error : missing ';' before 'type'
..\..\(32) : error C2065: 'times' : undeclared identifier   
..\..\(34) : error C2065: 'checksum1' : undeclared identifier
..\..\(38) : error C2065: 'times' : undeclared identifier
..\..\(40) : error C2065: 'checksum2' : undeclared identifier
..\..\(44) : error C2065: 'times' : undeclared identifier
..\..\(53) : error C2065: 'checksum2' : undeclared identifier
..\..\(55) : error C2065: 'checksum2' : undeclared identifier
..\..\(66) : error C2065: 'checksum1' : undeclared identifier
..\..\(68) : error C2065: 'checksum2' : undeclared identifier
Last edited on
I'm guessing this is just a small portion of the code as you have quite a few global varibles that aren't defined in this function.

times, checksum1 and checksum2 ARE defined in this function before all uses. I'm guessing that the errors are comming from another function in this file because times, checksum1 and checksum2 are destroyed at the end of the function.

I also don't see any lines that are missing the ;. This tells me that the code you posted isn't the one giving you the errors.
Topic archived. No new replies allowed.