Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix string literal conversion warnings in compile, runtime, control, ras, infra #7187

Merged
merged 5 commits into from
Dec 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions compiler/compile/OMRSymbolReferenceTable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,12 @@ OMR::SymbolReferenceTable::createKnownStaticDataSymbolRef(void *dataAddress, TR:
TR::SymbolReference *
OMR::SymbolReferenceTable::createKnownStaticReferenceSymbolRef(void *dataAddress, TR::KnownObjectTable::Index knownObjectIndex)
{
char *name = "<known-static-reference>";
const char *name = "<known-static-reference>";
if (knownObjectIndex != TR::KnownObjectTable::UNKNOWN)
{
name = (char*)trMemory()->allocateMemory(25, heapAlloc);
sprintf(name, "<known-obj%d>", knownObjectIndex);
char *nameBuffer = (char *)trMemory()->allocateMemory(25, heapAlloc);
sprintf(nameBuffer, "<known-obj%d>", knownObjectIndex);
name = nameBuffer;
}
TR::StaticSymbol * sym = TR::StaticSymbol::createNamed(trHeapMemory(), TR::Address, dataAddress,name);
return TR::SymbolReference::create(self(), sym, knownObjectIndex);
Expand Down Expand Up @@ -950,7 +951,7 @@ OMR::SymbolReferenceTable::findOrCreateMonitorEntrySymbolRef(TR::ResolvedMethodS
*/

TR::SymbolReference *
OMR::SymbolReferenceTable::methodSymRefFromName(TR::ResolvedMethodSymbol * owningMethodSymbol, char *className, char *methodName, char *methodSignature, TR::MethodSymbol::Kinds kind, int32_t cpIndex)
OMR::SymbolReferenceTable::methodSymRefFromName(TR::ResolvedMethodSymbol * owningMethodSymbol, const char *className, const char *methodName, const char *methodSignature, TR::MethodSymbol::Kinds kind, int32_t cpIndex)
{
// Check _methodsBySignature to see if we've already created a symref for this one
//
Expand Down
2 changes: 1 addition & 1 deletion compiler/compile/OMRSymbolReferenceTable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ class SymbolReferenceTable

int32_t getNumInternalPointers() { return _numInternalPointers; }

TR::SymbolReference * methodSymRefFromName(TR::ResolvedMethodSymbol *owningMethodSymbol, char *className, char *methodName, char *signature, TR::MethodSymbol::Kinds kind, int32_t cpIndex=-1);
TR::SymbolReference *methodSymRefFromName(TR::ResolvedMethodSymbol *owningMethodSymbol, const char *className, const char *methodName, const char *signature, TR::MethodSymbol::Kinds kind, int32_t cpIndex=-1);
dylanjtuttle marked this conversation as resolved.
Show resolved Hide resolved

TR::SymbolReference *createSymbolReference(TR::Symbol *sym, intptr_t o = 0);

Expand Down
2 changes: 1 addition & 1 deletion compiler/control/CompileMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int32_t init_options(TR::JitConfig *jitConfig, char *cmdLineOptions)
if (*cmdLineOptions == ':') cmdLineOptions++; // also skip :
}

char *endOptions = TR::Options::processOptionsJIT(cmdLineOptions, jitConfig, fe);
const char *endOptions = TR::Options::processOptionsJIT(cmdLineOptions, jitConfig, fe);
if (*endOptions)
{
fprintf(stderr, "JIT: fatal error: invalid command line at %s\n", endOptions);
Expand Down
Loading
Loading