=================== idDeclManagerLocal::GetChecksum =================== */
| 1041 | =================== |
| 1042 | */ |
| 1043 | int idDeclManagerLocal::GetChecksum( void ) const { |
| 1044 | int i, j, total, num; |
| 1045 | int *checksumData; |
| 1046 | |
| 1047 | // get the total number of decls |
| 1048 | total = 0; |
| 1049 | for ( i = 0; i < DECL_MAX_TYPES; i++ ) { |
| 1050 | total += linearLists[i].Num(); |
| 1051 | } |
| 1052 | |
| 1053 | checksumData = (int *) _alloca16( total * 2 * sizeof( int ) ); |
| 1054 | |
| 1055 | total = 0; |
| 1056 | for ( i = 0; i < DECL_MAX_TYPES; i++ ) { |
| 1057 | declType_t type = (declType_t) i; |
| 1058 | |
| 1059 | // FIXME: not particularly pretty but PDAs and associated decls are localized and should not be checksummed |
| 1060 | if ( type == DECL_PDA || type == DECL_VIDEO || type == DECL_AUDIO || type == DECL_EMAIL ) { |
| 1061 | continue; |
| 1062 | } |
| 1063 | |
| 1064 | num = linearLists[i].Num(); |
| 1065 | for ( j = 0; j < num; j++ ) { |
| 1066 | idDeclLocal *decl = linearLists[i][j]; |
| 1067 | |
| 1068 | if ( decl->sourceFile == &implicitDecls ) { |
| 1069 | continue; |
| 1070 | } |
| 1071 | |
| 1072 | checksumData[total*2+0] = total; |
| 1073 | checksumData[total*2+1] = decl->checksum; |
| 1074 | total++; |
| 1075 | } |
| 1076 | } |
| 1077 | |
| 1078 | LittleRevBytes( checksumData, sizeof(int), total * 2 ); |
| 1079 | return MD5_BlockChecksum( checksumData, total * 2 * sizeof( int ) ); |
| 1080 | } |
| 1081 | |
| 1082 | /* |
| 1083 | =================== |
no test coverage detected