diff options
author | texlive-bin package Avoid more compiler warnings <debian-tex-maint@lists.debian.org> | 2018-11-05 14:28:08 +0700 |
---|---|---|
committer | Daniel Glassey <wdg@debian.org> | 2018-11-05 14:28:08 +0700 |
commit | 5c5019ba5bb8b1263c74729c024f14f31f0644ca (patch) | |
tree | f57786e8b7c17b919a7b0cd110e6ad990cdeb18c | |
parent | c58455dc1444ac3b148593f491f204c78a8d66d7 (diff) |
patch-03-warnings
Gbp-Pq: Name patch-03-warnings
-rw-r--r-- | source/Compiler.cpp | 6 | ||||
-rw-r--r-- | source/Engine.cpp | 4 | ||||
-rw-r--r-- | source/Engine.h | 2 | ||||
-rw-r--r-- | source/Public-headers/TECkit_Compiler.h | 4 | ||||
-rw-r--r-- | source/Sample-tools/TECkit_Compile.cpp | 4 |
5 files changed, 10 insertions, 10 deletions
diff --git a/source/Compiler.cpp b/source/Compiler.cpp index 66b74c7..6158645 100644 --- a/source/Compiler.cpp +++ b/source/Compiler.cpp @@ -189,14 +189,14 @@ TECkit_DisposeCompiled(Byte* table) free(table); } -char* +const char* WINAPI TECkit_GetUnicodeName(UInt32 usv) { const CharName *c = &gUnicodeNames[0]; while (c->name != 0) if (c->usv == usv) - return (char*)c->name; + return c->name; else ++c; return NULL; @@ -2133,7 +2133,7 @@ Compiler::Error(const char* msg, const char* s, UInt32 line) cout << " at line " << line << endl; } else - (*errorFunction)(errFuncUserData, (char*)msg, (char*)s, line); + (*errorFunction)(errFuncUserData, msg, s, line); errorState = true; ++errorCount; } diff --git a/source/Engine.cpp b/source/Engine.cpp index 14a7b5f..8d050c1 100644 --- a/source/Engine.cpp +++ b/source/Engine.cpp @@ -1093,7 +1093,7 @@ if (traceLevel > 0) { if (matchElems == 0 && allowInsertion == false) continue; patternLength = matchElems + READ(rule->postLength); - pattern = (MatchElem*)(rule + 1); // point past the defined struct for the rule header + pattern = (const MatchElem*)(rule + 1); // point past the defined struct for the rule header direction = 1; infoLimit = matchElems; @@ -2194,7 +2194,7 @@ TECkit_GetMappingName( status = kStatus_BadMappingVersion; else { const Byte* namePtr; - if (getNamePtrFromTable((Byte*)fh, nameID, namePtr, *nameLength)) { + if (getNamePtrFromTable((const Byte*)fh, nameID, namePtr, *nameLength)) { UInt16 copyBytes = *nameLength < bufferSize ? *nameLength : bufferSize; if (copyBytes > 0) memcpy(nameBuffer, namePtr, copyBytes); diff --git a/source/Engine.h b/source/Engine.h index 10bdb11..ac8eaa8 100644 --- a/source/Engine.h +++ b/source/Engine.h @@ -117,7 +117,7 @@ protected: UInt32 match(int index, int repeats, int textLoc); // returns 0 for no match, 1 for match, or kNeedMoreInput/kInvalidChar - MatchElem* pattern; + const MatchElem* pattern; int patternLength; int direction; MatchInfo info[256]; diff --git a/source/Public-headers/TECkit_Compiler.h b/source/Public-headers/TECkit_Compiler.h index 688271d..b3f2db6 100644 --- a/source/Public-headers/TECkit_Compiler.h +++ b/source/Public-headers/TECkit_Compiler.h @@ -56,7 +56,7 @@ extern "C" { #define kCompilerOpts_Compress 0x00000010 /* generate compressed mapping table */ #define kCompilerOpts_XML 0x00000020 /* instead of a compiled binary table, generate an XML representation of the mapping */ -typedef void (CALLBACK *TECkit_ErrorFn)(void* userData, char* msg, char* param, UInt32 line); +typedef void (CALLBACK *TECkit_ErrorFn)(void* userData, const char* msg, const char* param, UInt32 line); TECkit_Status WINAPI EXPORTED @@ -75,7 +75,7 @@ WINAPI EXPORTED TECkit_GetCompilerVersion(); /* new APIs for looking up Unicode names (as NUL-terminated C strings) */ -char* +const char* WINAPI EXPORTED TECkit_GetUnicodeName(UInt32 usv); /* returns the Unicode name of usv, if available, else NULL */ diff --git a/source/Sample-tools/TECkit_Compile.cpp b/source/Sample-tools/TECkit_Compile.cpp index 5f85d8c..5924864 100644 --- a/source/Sample-tools/TECkit_Compile.cpp +++ b/source/Sample-tools/TECkit_Compile.cpp @@ -24,13 +24,13 @@ #endif extern "C" { - static void CALLBACK errFunc(void* userData, char* msg, char* param, UInt32 line); + static void CALLBACK errFunc(void* userData, const char* msg, const char* param, UInt32 line); }; static void CALLBACK -errFunc(void* /*userData*/, char* msg, char* param, UInt32 line) +errFunc(void* /* userData */, const char* msg, const char* param, UInt32 line) { fprintf(stderr, "%s", msg); if (param != 0) |