Commit 0a9daac5 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Use const, fix warnings

parent 5281ae07
...@@ -59,24 +59,24 @@ bool Program::IsPermanent(void){return permanent;} ...@@ -59,24 +59,24 @@ bool Program::IsPermanent(void){return permanent;}
bool Program::IsRTP(void){return b_rtp;} bool Program::IsRTP(void){return b_rtp;}
bool Program::HasPlGroup(void){return b_has_pl_group;} bool Program::HasPlGroup(void){return b_has_pl_group;}
void Program::SetName(char* n){name=n;} void Program::SetName(const char* n){name=n;}
void Program::SetUser(char* u){user=u;} void Program::SetUser(const char* u){user=u;}
void Program::SetMachine(char* m){machine=m;} void Program::SetMachine(const char* m){machine=m;}
void Program::SetSite(char* s){site=s;} void Program::SetSite(const char* s){site=s;}
void Program::SetAddress(char* a){address=a;} void Program::SetAddress(const char* a){address=a;}
void Program::SetPlGroup(char *h){pl_group=h;} void Program::SetPlGroup(const char *h){pl_group=h;}
void Program::SetRTP(bool b){b_rtp = b;} void Program::SetRTP(bool b){b_rtp = b;}
void Program::SetHasPlGroup(bool b){b_has_pl_group = b ;} void Program::SetHasPlGroup(bool b){b_has_pl_group = b ;}
void Program::SetPort(char* p) void Program::SetPort(const char* p)
{ {
int i_port=atoi(p); int i_port=atoi(p);
char psz_port[12]; char psz_port[6];
sprintf(psz_port,"%i",i_port); snprintf(psz_port, sizeof (psz_port), "%i",i_port);
port +=psz_port; port +=psz_port;
} }
void Program::SetTTL(char *p){program_ttl=p;} void Program::SetTTL(const char *p){program_ttl=p;}
Program::Program(string n, string u, string m, string s, string a,string p) Program::Program(string n, string u, string m, string s, string a,string p)
: b_has_pl_group (false) : b_has_pl_group (false)
......
...@@ -40,14 +40,14 @@ class Program ...@@ -40,14 +40,14 @@ class Program
string GetPlGroup(); string GetPlGroup();
/* Functions to set the values */ /* Functions to set the values */
void SetName(char*); void SetName(const char*);
void SetUser(char*); void SetUser(const char*);
void SetMachine(char*); void SetMachine(const char*);
void SetSite(char*); void SetSite(const char*);
void SetAddress(char*); void SetAddress(const char*);
void SetPort(char *); void SetPort(const char *);
void SetTTL(char *); void SetTTL(const char *);
void SetPlGroup(char *); void SetPlGroup(const char *);
void SetHasPlGroup(bool); void SetHasPlGroup(bool);
void SetRTP(bool); void SetRTP(bool);
......
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