commit db0b76ab00364d7e0867c88f243ac12e8c357237
parent 4b456eece4528c9b4fa0ab2c9bb9ed2e557bb128
Author: fundamental <[email protected]>
Date: Fri, 15 Jul 2016 09:50:00 -0400
Convert rindex Calls To strrchr
Diffstat:
5 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/Effects/EffectMgr.cpp b/src/Effects/EffectMgr.cpp
@@ -79,7 +79,7 @@ static const rtosc::Ports local_ports = {
//update parameters as well
strncpy(loc, d.loc, 1024);
- char *tail = rindex(loc, '/');
+ char *tail = strrchr(loc, '/');
if(!tail)
return;
for(int i=0;i<128;++i) {
diff --git a/src/Misc/MiddleWare.cpp b/src/Misc/MiddleWare.cpp
@@ -148,7 +148,7 @@ static int handler_function(const char *path, const char *types, lo_arg **argv,
lo_message_serialise(msg, path, buffer, &size);
if(!strcmp(buffer, "/path-search") && !strcmp("ss", rtosc_argument_string(buffer))) {
path_search(buffer, mw->activeUrl().c_str());
- } else if(buffer[0]=='/' && rindex(buffer, '/')[1]) {
+ } else if(buffer[0]=='/' && strrchr(buffer, '/')[1]) {
mw->transmitMsg(rtosc::Ports::collapsePath(buffer));
}
@@ -1604,7 +1604,7 @@ void MiddleWareImpl::kitEnable(int part, int kit, int type)
void MiddleWareImpl::handleMsg(const char *msg)
{
//Check for known bugs
- assert(msg && *msg && rindex(msg, '/')[1]);
+ assert(msg && *msg && strrchr(msg, '/')[1]);
assert(strstr(msg,"free") == NULL || strstr(rtosc_argument_string(msg), "b") == NULL);
assert(strcmp(msg, "/part0/Psysefxvol"));
assert(strcmp(msg, "/Penabled"));
@@ -1619,7 +1619,7 @@ void MiddleWareImpl::handleMsg(const char *msg)
fprintf(stdout, "%c[%d;%d;%dm", 0x1B, 0, 7 + 30, 0 + 40);
}
- const char *last_path = rindex(msg, '/');
+ const char *last_path = strrchr(msg, '/');
if(!last_path) {
printf("Bad message in handleMsg() <%s>\n", msg);
assert(false);
diff --git a/src/Synth/OscilGen.cpp b/src/Synth/OscilGen.cpp
@@ -96,7 +96,7 @@ const rtosc::Ports OscilGen::non_realtime_ports = {
phase = rtosc_argument(m,0).i;
//XXX hack hack
char *repath = strdup(d.loc);
- char *edit = rindex(repath, '/')+1;
+ char *edit = strrchr(repath, '/')+1;
strcpy(edit, "prepare");
OscilGen &o = *((OscilGen*)d.obj);
fft_t *data = new fft_t[o.synth.oscilsize / 2];
@@ -120,7 +120,7 @@ const rtosc::Ports OscilGen::non_realtime_ports = {
//printf("setting magnitude\n\n");
//XXX hack hack
char *repath = strdup(d.loc);
- char *edit = rindex(repath, '/')+1;
+ char *edit = strrchr(repath, '/')+1;
strcpy(edit, "prepare");
OscilGen &o = *((OscilGen*)d.obj);
fft_t *data = new fft_t[o.synth.oscilsize / 2];
diff --git a/src/UI/Connection.cpp b/src/UI/Connection.cpp
@@ -428,7 +428,7 @@ class UI_Interface:public Fl_Osc_Interface
//DEBUG
//if(strcmp(msg, "/vu-meter"))//Ignore repeated message
// printf("trying the link for a '%s'<%s>\n", msg, rtosc_argument_string(msg));
- const char *handle = rindex(msg,'/');
+ const char *handle = strrchr(msg,'/');
if(handle)
++handle;
diff --git a/src/UI/guimain.cpp b/src/UI/guimain.cpp
@@ -470,7 +470,7 @@ class UI_Interface:public Fl_Osc_Interface
//DEBUG
//if(strcmp(msg, "/vu-meter"))//Ignore repeated message
// printf("trying the link for a '%s'<%s>\n", msg, rtosc_argument_string(msg));
- const char *handle = rindex(msg,'/');
+ const char *handle = strrchr(msg,'/');
if(handle)
++handle;