Skip to content

Commit d602d7c

Browse files
committed
Use const strings for the plugin info names
1 parent cb39519 commit d602d7c

7 files changed

Lines changed: 20 additions & 20 deletions

File tree

0 Bytes
Binary file not shown.
4.5 KB
Binary file not shown.

Source/Plugins/KWIKFormat/OpenEphysLib.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ using namespace Plugin;
3939
extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
4040
{
4141
info->apiVersion = PLUGIN_API_VER;
42-
strcpy_s(info->name, "Kwik Format");
42+
info->name = "Kwik Format";
4343
info->numPlugins = NUM_PLUGINS;
4444
}
4545

@@ -49,13 +49,13 @@ extern "C" EXPORT int getPluginInfo(int index, Plugin::PluginInfo* info)
4949
{
5050
case 0:
5151
info->type = Plugin::RecordEnginePlugin;
52-
strcpy(info->recordEngine.name, "Kwik");
52+
info->recordEngine.name = "Kwik";
5353
info->recordEngine.creator = &(Plugin::createRecordEngine<HDF5Recording>);
5454
break;
5555
case 1:
5656
info->type = Plugin::FileSourcePlugin;
57-
strcpy(info->fileSource.name, "Kwd file");
58-
strcpy(info->fileSource.extensions, "kwd");
57+
info->fileSource.name = "Kwd file";
58+
info->fileSource.extensions = "kwd";
5959
info->fileSource.creator = &(Plugin::createFileSource<KWIKFileSource>);
6060
break;
6161
default:

Source/Plugins/LfpDisplayNode/OpenEphysLib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ using namespace Plugin;
3737
extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
3838
{
3939
info->apiVersion = PLUGIN_API_VER;
40-
strcpy(info->name, "LFP viewer");
40+
info->name = "LFP viewer";
4141
info->numPlugins = NUM_PLUGINS;
4242
}
4343

@@ -47,7 +47,7 @@ extern "C" EXPORT int getPluginInfo(int index, Plugin::PluginInfo* info)
4747
{
4848
case 0:
4949
info->type = Plugin::ProcessorPlugin;
50-
strcpy(info->processor.name, "LFP viewer");
50+
info->processor.name = "LFP viewer";
5151
info->processor.type = Plugin::SinkProcessor;
5252
info->processor.creator = &(Plugin::createProcessor<LfpDisplayNode>);
5353
break;

Source/Plugins/RhythmNode/OpenEphysLib.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ using namespace Plugin;
3838
extern "C" EXPORT void getLibInfo(Plugin::LibraryInfo* info)
3939
{
4040
info->apiVersion = PLUGIN_API_VER;
41-
strcpy(info->name, "Rhythm Node");
41+
info->name = "Rhythm Node";
4242
info->numPlugins = NUM_PLUGINS;
4343
}
4444

@@ -48,7 +48,7 @@ extern "C" EXPORT int getPluginInfo(int index, Plugin::PluginInfo* info)
4848
{
4949
case 0:
5050
info->type = Plugin::DatathreadPlugin;
51-
strcpy(info->dataThread.name, "Rhythm FPGA");
51+
info->dataThread.name = "Rhythm FPGA";
5252
info->dataThread.creator = &(Plugin::createDataThread<RHD2000Thread>);
5353
break;
5454
default:

Source/Processors/PluginManager/OpenEphysPlugin.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,33 +68,33 @@ namespace Plugin
6868

6969
struct ProcessorInfo
7070
{
71-
char name[100];
71+
const char* name;
7272
ProcessorCreator creator;
7373
ProcessorType type;
7474
};
7575

7676
struct DataThreadInfo
7777
{
78-
char name[100];
78+
const char* name;
7979
DataThreadCreator creator;
8080
};
8181

8282
struct RecordEngineInfo
8383
{
84-
char name[100];
84+
const char* name;
8585
EngineManagerCreator creator;
8686
};
8787

8888
struct FileSourceInfo
8989
{
90-
char name[100];
90+
const char* name;
9191
FileSourceCreator creator;
92-
char extensions[100]; //Semicolon separated list of extensions. Eg: "txt;dat;info;kwd"
92+
const char* extensions; //Semicolon separated list of extensions. Eg: "txt;dat;info;kwd"
9393
};
9494

9595
struct LibraryInfo
9696
{
97-
char name[300];
97+
const char* name;
9898
int apiVersion;
9999
int numPlugins;
100100
};

Source/Processors/PluginManager/PluginManager.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ int PluginManager::loadPlugin(const String& pluginLoc) {
178178

179179
LoadedLibInfo lib;
180180
lib.apiVersion = libInfo.apiVersion;
181-
strcpy(lib.name,libInfo.name);
181+
lib.name = libInfo.name;
182182
lib.numPlugins = libInfo.numPlugins;
183183
lib.handle = handle;
184184

@@ -195,7 +195,7 @@ int PluginManager::loadPlugin(const String& pluginLoc) {
195195
{
196196
LoadedPluginInfo<Plugin::ProcessorInfo> info;
197197
info.creator = pInfo.processor.creator;
198-
strcpy(info.name, pInfo.processor.name);
198+
info.name = pInfo.processor.name;
199199
info.type = pInfo.processor.type;
200200
info.libIndex = libArray.size();
201201
processorPlugins.add(info);
@@ -205,7 +205,7 @@ int PluginManager::loadPlugin(const String& pluginLoc) {
205205
{
206206
LoadedPluginInfo<Plugin::RecordEngineInfo> info;
207207
info.creator = pInfo.recordEngine.creator;
208-
strcpy(info.name, pInfo.recordEngine.name);
208+
info.name = pInfo.recordEngine.name;
209209
info.libIndex = libArray.size();
210210
recordEnginePlugins.add(info);
211211
break;
@@ -214,7 +214,7 @@ int PluginManager::loadPlugin(const String& pluginLoc) {
214214
{
215215
LoadedPluginInfo<Plugin::DataThreadInfo> info;
216216
info.creator = pInfo.dataThread.creator;
217-
strcpy(info.name, pInfo.dataThread.name);
217+
info.name = pInfo.dataThread.name;
218218
info.libIndex = libArray.size();
219219
dataThreadPlugins.add(info);
220220
break;
@@ -223,8 +223,8 @@ int PluginManager::loadPlugin(const String& pluginLoc) {
223223
{
224224
LoadedPluginInfo<Plugin::FileSourceInfo> info;
225225
info.creator = pInfo.fileSource.creator;
226-
strcpy(info.name, pInfo.fileSource.name);
227-
strcpy(info.extensions, pInfo.fileSource.extensions);
226+
info.name = pInfo.fileSource.name;
227+
info.extensions = pInfo.fileSource.extensions;
228228
info.libIndex = libArray.size();
229229
fileSourcePlugins.add(info);
230230
break;

0 commit comments

Comments
 (0)