Skip to content
Snippets Groups Projects
Commit 9e6c9d52 authored by Claudio Scafuri's avatar Claudio Scafuri :speech_balloon:
Browse files

compile on 18.04 x86_64, removed compiler warnings, gitlab conventions

parent 889eedd7
No related branches found
No related tags found
No related merge requests found
......@@ -21,12 +21,12 @@ class RPCWriteHandle : public RPCHandle
RPCWriteHandle(RPCHandle *h);
~RPCWriteHandle();
bool write_long(const char *callname, long lvalue);
bool write_double(const char *callname, double dvalue);
bool write_short(const char *callname, short svalue);
bool write_boolean(const char *callname, bool bval);
bool write_string(const char *callname, char **string);
bool write_void(const char *callname);
bool write_long(const char *callname, idl_long_int lvalue);
bool write_double(const char *callname, double dvalue);
bool write_short(const char *callname, idl_short_int svalue);
bool write_boolean(const char *callname, bool bval);
bool write_string(const char *callname, char **string);
bool write_void(const char *callname);
private:
......
......@@ -28,8 +28,8 @@ AttributeConverter::AttributeConverter(char *propertyName, bool force_spectrum)
char fam[RPCSPLITLEN], mem[RPCSPLITLEN], act[RPCSPLITLEN], mode[RPCSPLITLEN];
UserDefaultAttrProp default_att_prop;
Database *db = new Database();
DbData data;
//Database *db = new Database();
//DbData data;
memset(fam, 0, RPCSPLITLEN);
memset(mem, 0, RPCSPLITLEN);
......@@ -69,8 +69,9 @@ AttributeConverter::AttributeConverter(char *propertyName, bool force_spectrum)
}
else if(data_type < 0)
{
snprintf(res, 256, "\e[1;31m* \e[0merror creating \"%s\""
"\e[0;37m [\e[1;31munrecognized data type \e[0;37m]\e[0m", propertyName);
// snprintf(res, 256, "\e[1;31m* \e[0merror creating \"%s\""
// "\e[0;37m [\e[1;31munrecognized data type \e[0;37m]\e[0m", propertyName);
snprintf(res, 256, "merror creating %s :unrecognized data type ", propertyName);
result = string(res);
}
}
......@@ -103,7 +104,7 @@ bool AttributeConverter::string1_contains2(const char* s1, const char* s2)
*/
bool AttributeConverter::isReadWrite(char* entry, char * rname, char *rwname)
{
int i;
unsigned int i;
memset(rname, 0, MAXLEN);
memset(rwname, 0, MAXLEN);
for(i = 0; i< MAXLEN - 1 && i < strlen(entry); i++)
......@@ -192,9 +193,10 @@ SpectrumBridgeAttr* AttributeConverter::createSpectrumAttribute(const char* name
if(spattr != NULL)
{
snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mspectrum"
"\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRO\e[0;37m]\e[0m",
name, dataType(data_type).c_str());
// snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mspectrum"
// "\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRO\e[0;37m]\e[0m",
// name, dataType(data_type).c_str());
snprintf(res, 256, "created %s spectrum %s", name, dataType(data_type).c_str());
result = string(res);
default_att_prop.set_description(desc);
......@@ -217,9 +219,12 @@ BridgeAttr* AttributeConverter::createScalarAttribute(const char* name, long int
if(attr != NULL)
{
snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mscalar"
"\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRO\e[0;37m]\e[0m",
name, dataType(data_type).c_str());
// snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mscalar"
// "\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRO\e[0;37m]\e[0m",
// name, dataType(data_type).c_str());
snprintf(res, 256, "created %s scalar %s", name, dataType(data_type).c_str());
result = string(res);
default_att_prop.set_description(desc);
attr->set_default_properties(default_att_prop);
......@@ -241,9 +246,12 @@ BridgeAttr* AttributeConverter::createScalarAttribute(const char* name, const ch
printf(".....createScalarAttribute_write %s %s\n",name,writeName);
if(attr != NULL)
{
snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mscalar"
"\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRW\e[0;37m]\e[0m",
name, dataType(data_type).c_str());
// snprintf(res, 256, "\e[1;32m* \e[0mcreated \"%s\"\t\e[0;37m[\e[0;32mscalar"
// "\e[0;37m, \e[0;32m%s\e[0;37m, \e[0;32mRW\e[0;37m]\e[0m",
// name, dataType(data_type).c_str());
snprintf(res, 256, "created %s scalar %s", name, dataType(data_type).c_str());
default_att_prop.set_description(desc);
attr->set_default_properties(default_att_prop);
}
......
File moved
static const char *RcsId = "$Header: /home/cvsadm/cvsroot/elettra/server/RPC2TangoBridge/main.cpp,v 1.1.1.1 2008-04-28 09:13:16 giacomo Exp $";
//+=============================================================================
//
// file : main.cpp
......@@ -37,7 +36,7 @@ static const char *RcsId = "$Header: /home/cvsadm/cvsroot/elettra/server/RPC2Tan
int main(int argc,char *argv[])
{
Tango::Util *tg;
Tango::Util *tg=0;
try
{
// Initialise the device server
......@@ -66,6 +65,6 @@ int main(int argc,char *argv[])
cout << "Received a CORBA_Exception" << endl;
cout << "Exiting" << endl;
}
tg->server_cleanup();
if (tg) tg->server_cleanup();
return(0);
}
......@@ -35,7 +35,6 @@ void RPC2TangoBridge::read_dynamic_attribute(Tango::Attribute &attr)
int i;
int ok;
bool release = true; /* tells Attribute::set_value to free memory after usage */
char error[256];
/* search name in scalars map first */
......@@ -141,6 +140,7 @@ void RPC2TangoBridge::read_dynamic_attribute(Tango::Attribute &attr)
if(ok)
{
DevBoolean *db = new DevBoolean;
sb.length = 1;
if(rpcBool == 0)
*db = false;
else
......@@ -157,6 +157,7 @@ void RPC2TangoBridge::read_dynamic_attribute(Tango::Attribute &attr)
if(ok)
{
DevBoolean *db = new DevBoolean;
sb.length = 1;
if(rpcBool == 0)
*db = false;
else
......
......@@ -22,19 +22,12 @@ bool RPC2TangoBridge::write_dynamic_attribute(Tango::WAttribute &attr)
DevShort ds;
DevDouble dd;
DevBoolean db;
long int l;
double d;
short s;
unsigned char uc;
string ress;
bool b;
int i;
bool release = true; /* tells Attribute::set_value to free memory after usage */
char error[256];
/* search name in scalars map first */
map<string, BridgeAttr*>::iterator mapiter;
mapiter = namesMap.find(attr.get_name());
......
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