Clang warnings: sprintf() => epicsSnprintf()
This commit is contained in:
committed by
mdavidsaver
parent
11c7bc11c4
commit
7f9b6129e3
@@ -6,8 +6,8 @@
|
||||
|
||||
#include <iostream>
|
||||
#include <queue>
|
||||
#include <cstdio>
|
||||
#include <cantProceed.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsThread.h>
|
||||
#include <epicsMutex.h>
|
||||
#include <epicsGuard.h> // Needed for 3.15 builds
|
||||
@@ -40,7 +40,7 @@ void NotifierConveyor::start()
|
||||
{
|
||||
if (thread) return;
|
||||
char name[40];
|
||||
std::sprintf(name, "pva::ca::conveyor %p", this);
|
||||
epicsSnprintf(name, sizeof(name), "pva::ca::conveyor %p", this);
|
||||
thread = std::tr1::shared_ptr<epicsThread>(new epicsThread(*this, name,
|
||||
epicsThreadGetStackSize(epicsThreadStackBig),
|
||||
epicsThreadPriorityLow));
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include <stdio.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsStdlib.h>
|
||||
#include <epicsGetopt.h>
|
||||
#include <epicsExit.h>
|
||||
@@ -138,7 +138,7 @@ int main (int argc, char *argv[])
|
||||
char buf[16];
|
||||
for (size_t i = 0; i < nChannels; i++)
|
||||
{
|
||||
sprintf(buf, "test%zu", (i+1));
|
||||
epicsSnprintf(buf, sizeof(buf), "test%zu", (i+1));
|
||||
channels.push_back(provider->createChannel(buf, channelRequester));
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <pv/clientFactory.h>
|
||||
#include <pv/pvAccess.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsStdlib.h>
|
||||
#include <epicsGetopt.h>
|
||||
#include <epicsThread.h>
|
||||
@@ -301,9 +301,9 @@ void runTest()
|
||||
for (int i = 0; i < channels; i++)
|
||||
{
|
||||
if (arraySize > 0)
|
||||
sprintf(buf, "testArray%d_%d", arraySize, i);
|
||||
epicsSnprintf(buf, sizeof(buf), "testArray%d_%d", arraySize, i);
|
||||
else
|
||||
sprintf(buf, "test%d", i);
|
||||
epicsSnprintf(buf, sizeof(buf), "test%d", i);
|
||||
channelNames.push_back(buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <pv/clientFactory.h>
|
||||
#include <pv/pvAccess.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsStdlib.h>
|
||||
#include <epicsGetopt.h>
|
||||
#include <epicsThread.h>
|
||||
@@ -286,9 +286,9 @@ void runTest()
|
||||
for (int i = 0; i < channels; i++)
|
||||
{
|
||||
if (arraySize > 0)
|
||||
sprintf(buf, "testArray%d_%d", arraySize, i);
|
||||
epicsSnprintf(buf, sizeof(buf), "testArray%d_%d", arraySize, i);
|
||||
else
|
||||
sprintf(buf, "test%d", i);
|
||||
epicsSnprintf(buf, sizeof(buf), "test%d", i);
|
||||
channelNames.push_back(buf);
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <pv/serverContext.h>
|
||||
#include <pv/clientContextImpl.h>
|
||||
#include <epicsStdio.h>
|
||||
#include <epicsExit.h>
|
||||
#include <pv/standardPVField.h>
|
||||
#include <pv/pvTimeStamp.h>
|
||||
@@ -273,7 +274,7 @@ static epics::pvData::PVStructure::shared_pointer createNTTable(int columnsCount
|
||||
PVStringArray::svector labels(columnsCount);
|
||||
for (int i = 0; i < columnsCount; i++)
|
||||
{
|
||||
sprintf(sbuf, "column%d", i);
|
||||
epicsSnprintf(sbuf, sizeof(sbuf), "column%d", i);
|
||||
fieldNames[i] = sbuf;
|
||||
fields[i] = getFieldCreate()->createScalarArray(pvDouble);
|
||||
labels[i] = sbuf;
|
||||
@@ -315,7 +316,7 @@ static epics::pvData::PVStructure::shared_pointer createNTNameValue(int columnsC
|
||||
PVStringArray::svector labels(columnsCount);
|
||||
for (int i = 0; i < columnsCount; i++)
|
||||
{
|
||||
sprintf(sbuf, "name%d", i);
|
||||
epicsSnprintf(sbuf, sizeof(sbuf), "name%d", i);
|
||||
fieldNames[i] = sbuf;
|
||||
fields[i] = getFieldCreate()->createScalarArray(pvDouble);
|
||||
labels[i] = sbuf;
|
||||
@@ -1318,7 +1319,7 @@ public:
|
||||
PVStringArray::svector labels(columnsCount);
|
||||
for (int i = 0; i < columnsCount; i++)
|
||||
{
|
||||
sprintf(sbuf, "name%d", i);
|
||||
epicsSnprintf(sbuf, sizeof(sbuf), "name%d", i);
|
||||
labels[i] = sbuf;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user