Commit cdf08ec4 authored by IOhannes m zmölnig's avatar IOhannes m zmölnig
Browse files

pass more strings by reference

parent 33d4707b
......@@ -182,20 +182,20 @@ void GemWindow::info(std::vector<t_atom>l) {
void GemWindow::info(t_symbol*s, int argc, t_atom*argv) {
m_pimpl->queue(s, argc, argv);
}
void GemWindow::info(std::string s) {
void GemWindow::info(const std::string& s) {
info(gensym(s.c_str()), 0, 0);
}
void GemWindow::info(std::string s, int i) {
void GemWindow::info(const std::string& s, int i) {
info(s, (t_float)i);
}
void GemWindow :: info(std::string s, t_float value)
void GemWindow :: info(const std::string& s, t_float value)
{
t_atom atom;
SETFLOAT(&atom, value);
info(gensym(s.c_str()), 1, &atom);
}
void GemWindow :: info(std::string s, std::string value)
void GemWindow :: info(const std::string& s, const std::string& value)
{
t_atom atom;
SETSYMBOL(&atom, gensym(value.c_str()));
......@@ -244,7 +244,7 @@ void GemWindow::entry(int devId, int state)
}
/* keyboard buttons */
void GemWindow::key(int devId, std::string sid, int iid, int state) {
void GemWindow::key(int devId, const std::string& sid, int iid, int state) {
t_atom ap[4];
SETFLOAT (ap+0, devId);
SETSYMBOL(ap+1, gensym("keyname"));
......
......@@ -57,10 +57,10 @@ class GEM_EXTERN GemWindow : public CPPExtern
/* LATER think about detaching the output from the stack, so we can e.g. destroy a window from a mouse-callback */
void info(std::vector<t_atom>);
void info(t_symbol*s, int, t_atom*);
void info(std::string);
void info(std::string, t_float);
void info(std::string, int i);
void info(std::string, std::string);
void info(const std::string&);
void info(const std::string&, t_float);
void info(const std::string&, int i);
void info(const std::string&, const std::string&);
/* tell downstream objects to render */
void bang(void);
......@@ -72,7 +72,7 @@ class GEM_EXTERN GemWindow : public CPPExtern
/* mouse entering window */
void entry(int devId, int state);
/* keyboard buttons */
void key(int devId, std::string, int, int state);
void key(int devId, const std::string&, int, int state);
/* window resize/move */
void dimension(unsigned int, unsigned int);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment