- Timestamp:
- Jun 4, 2007 5:20:29 PM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/kObjCache/kObjCache.c
r1024 r1036 952 952 * Pinpoint the difference exactly and the try find the start 953 953 * of that line. Then skip forward until we find something to 954 * work on that isn't spaces or #line statements. Since we 955 * might be skipping a few new empty headers, it is possible 956 * that we will omit this header from the dependencies when 957 * using VCC. But I think that's a reasonable trade off for 958 * a simple algorithm. 954 * work on that isn't spaces, #line statements or closing curly 955 * braces. 956 * 957 * The closing curly braces are ignored because they are frequently 958 * found at the end of header files (__END_DECLS) and the worst 959 * thing that may happen if it isn't one of these braces we're 960 * ignoring is that the final line in a function block is a little 961 * bit off in the debug info. 962 * 963 * Since we might be skipping a few new empty headers, it is 964 * possible that we will omit this header from the dependencies 965 * when using VCC. This might not be a problem, since it seems 966 * we'll have to use the precompiler output to generate the deps 967 * anyway. 959 968 */ 960 969 const char *psz; … … 962 971 const char *pszFile1 = NULL; 963 972 unsigned iLine1 = 0; 973 unsigned cCurlyBraces1 = 0; 964 974 const char *pszMismatch2; 965 975 const char *pszFile2 = NULL; 966 976 unsigned iLine2 = 0; 977 unsigned cCurlyBraces2 = 0; 967 978 968 979 /* locate the difference. */ … … 1007 1018 psz1 = pszEnd1; 1008 1019 } 1020 else if (*psz == '}') 1021 { 1022 do psz++; 1023 while (isspace(*psz) && *psz != '\n'); 1024 if (*psz == '\n') 1025 iLine1++; 1026 else if (psz != pszEnd1) 1027 break; 1028 cCurlyBraces1++; 1029 psz1 = psz; 1030 } 1009 1031 else if (psz == pszEnd1) 1010 1032 psz1 = psz; … … 1038 1060 psz2 = pszEnd2; 1039 1061 } 1062 else if (*psz == '}') 1063 { 1064 do psz++; 1065 while (isspace(*psz) && *psz != '\n'); 1066 if (*psz == '\n') 1067 iLine2++; 1068 else if (psz != pszEnd2) 1069 break; 1070 cCurlyBraces2++; 1071 psz2 = psz; 1072 } 1040 1073 else if (psz == pszEnd2) 1041 1074 psz2 = psz; … … 1044 1077 } 1045 1078 } 1079 1080 /* Match the number of ignored closing curly braces. */ 1081 if (cCurlyBraces1 != cCurlyBraces2) 1082 return 0; 1046 1083 1047 1084 /* Reaching the end of any of them means the return statement can decide. */
Note:
See TracChangeset
for help on using the changeset viewer.