uORB: Update code style

This commit is contained in:
Lorenz Meier
2015-10-19 13:51:18 +02:00
parent af1fe6ab9b
commit c19c8a35b2
5 changed files with 121 additions and 110 deletions
+25 -24
View File
@@ -37,45 +37,46 @@
int uORB::Utils::node_mkpath
(
char *buf,
Flavor f,
const struct orb_metadata *meta,
int *instance
char *buf,
Flavor f,
const struct orb_metadata *meta,
int *instance
)
{
unsigned len;
unsigned len;
unsigned index = 0;
unsigned index = 0;
if (instance != nullptr) {
index = *instance;
}
if (instance != nullptr) {
index = *instance;
}
len = snprintf(buf, orb_maxpath, "/%s/%s%d",
(f == PUBSUB) ? "obj" : "param",
meta->o_name, index);
len = snprintf(buf, orb_maxpath, "/%s/%s%d",
(f == PUBSUB) ? "obj" : "param",
meta->o_name, index);
if (len >= orb_maxpath) {
return -ENAMETOOLONG;
}
if (len >= orb_maxpath) {
return -ENAMETOOLONG;
}
return OK;
return OK;
}
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
int uORB::Utils::node_mkpath(char *buf, Flavor f,
const char *orbMsgName )
const char *orbMsgName)
{
unsigned len;
unsigned len;
unsigned index = 0;
unsigned index = 0;
len = snprintf(buf, orb_maxpath, "/%s/%s%d", (f == PUBSUB) ? "obj" : "param",
orbMsgName, index );
len = snprintf(buf, orb_maxpath, "/%s/%s%d", (f == PUBSUB) ? "obj" : "param",
orbMsgName, index);
if (len >= orb_maxpath)
return -ENAMETOOLONG;
if (len >= orb_maxpath) {
return -ENAMETOOLONG;
}
return OK;
return OK;
}