Skip to content
Browse files

Some more newline quirks

  • Loading branch information...
1 parent 9980950 commit 7c975b37127417258d8efefd81cb75d0b45bacff @sven-ola sven-ola committed Nov 23, 2008
Showing with 112 additions and 228 deletions.
  1. +1 −1 gnu-indent.sh
  2. +2 −4 gui/linux-gtk/src/nodes.c
  3. +1 −2 gui/win32/Main/TrayIcon.h
  4. +1 −2 lib/arprefresh/src/olsrd_arprefresh.h
  5. +2 −4 lib/bmf/src/Bmf.c
  6. +1 −2 lib/bmf/src/Bmf.h
  7. +1 −2 lib/dot_draw/src/olsrd_dot_draw.c
  8. +1 −2 lib/dot_draw/src/olsrd_dot_draw.h
  9. +2 −4 lib/dyn_gw/src/olsrd_dyn_gw.c
  10. +1 −2 lib/dyn_gw/src/olsrd_dyn_gw.h
  11. +1 −2 lib/dyn_gw_plain/src/olsrd_dyn_gw_plain.c
  12. +2 −4 lib/httpinfo/src/olsrd_httpinfo.c
  13. +1 −2 lib/httpinfo/src/olsrd_plugin.h
  14. +1 −2 lib/nameservice/src/mapwrite.c
  15. +1 −2 lib/nameservice/src/nameservice.c
  16. +1 −2 lib/nameservice/src/nameservice.h
  17. +1 −2 lib/pgraph/src/olsrd_pgraph.h
  18. +2 −4 lib/secure/src/olsrd_secure.c
  19. +3 −6 lib/tas/src/http.c
  20. +2 −4 lib/tas/src/lib.h
  21. +1 −2 lib/tas/src/lua/lauxlib.c
  22. +3 −6 lib/tas/src/lua/lauxlib.h
  23. +1 −2 lib/tas/src/lua/lbaselib.c
  24. +1 −2 lib/tas/src/lua/lcode.c
  25. +5 −10 lib/tas/src/lua/ldebug.h
  26. +1 −2 lib/tas/src/lua/lgc.c
  27. +2 −4 lib/tas/src/lua/llex.c
  28. +1 −2 lib/tas/src/lua/llex.h
  29. +1 −2 lib/tas/src/lua/lparser.c
  30. +2 −4 lib/tas/src/lua/lstrlib.c
  31. +4 −8 lib/tas/src/lua/ltests.c
  32. +2 −4 lib/tas/src/lua/lvm.c
  33. +4 −8 lib/txtinfo/src/olsrd_txtinfo.c
  34. +1 −2 lib/txtinfo/src/olsrd_txtinfo.h
  35. +4 −8 src/bsd/net.c
  36. +2 −4 src/build_msg.c
  37. +9 −18 src/fpm.c
  38. +1 −2 src/ipcalc.c
  39. +3 −8 src/link_set.c
  40. +1 −2 src/linux/apm.c
  41. +1 −2 src/linux/kernel_routes.c
  42. +1 −2 src/log.h
  43. +1 −2 src/lq_plugin_default_ff.c
  44. +1 −2 src/lq_plugin_default_fpm.c
  45. +4 −8 src/mpr.c
  46. +4 −9 src/neighbor_table.h
  47. +1 −2 src/olsr.h
  48. +2 −4 src/olsr_cookie.c
  49. +2 −4 src/olsr_switch/main.c
  50. +1 −3 src/olsr_switch/ohs_cmd.c
  51. +1 −2 src/olsrd_plugin.h
  52. +1 −2 src/packet.c
  53. +3 −6 src/parser.c
  54. +1 −2 src/plugin_loader.c
  55. +2 −4 src/process_package.c
  56. +2 −4 src/routing_table.c
  57. +2 −5 src/two_hop_neighbor_table.h
  58. +1 −2 src/unix/ifnet.c
  59. +1 −2 src/win32/compat.c
  60. +2 −4 src/win32/ifnet.c
  61. +1 −2 src/win32/net.c
View
2 gnu-indent.sh
@@ -31,6 +31,6 @@ test "--cmp" = "$1" && {
# Note: may help to compare two messy formatted source trees.
addon="--swallow-optional-blank-lines --ignore-newlines"
shift
-}
+}
indent $(cat ${0%/*}/src/.indent.pro) $addon $* $(find -name "*.[ch]" -not -path "*/.hg*")
View
6 gui/linux-gtk/src/nodes.c
@@ -282,8 +282,7 @@ add_hna_node(union olsr_ip_addr *node, union olsr_ip_addr *net, union olsr_ip_ad
for (tmp_nodes = nodes.next; tmp_nodes != &nodes; tmp_nodes = tmp_nodes->next) {
if (memcmp(&tmp_nodes->addr, node, ipsize) == 0) {
for (tmp_hna = tmp_nodes->hna.next; tmp_hna != &tmp_nodes->hna; tmp_hna = tmp_hna->next) {
- if ((memcmp(&tmp_hna->net, net, ipsize) == 0)
- && (memcmp(&tmp_hna->mask, mask, ipsize) == 0))
+ if ((memcmp(&tmp_hna->net, net, ipsize) == 0) && (memcmp(&tmp_hna->mask, mask, ipsize) == 0))
return 0;
}
@@ -488,8 +487,7 @@ find_node(char *ip)
struct node *tmp_nodes;
for (tmp_nodes = nodes.next; tmp_nodes != &nodes; tmp_nodes = tmp_nodes->next) {
- if (strcmp(ip_to_string((union olsr_ip_addr *)&tmp_nodes->addr), ip)
- == 0)
+ if (strcmp(ip_to_string((union olsr_ip_addr *)&tmp_nodes->addr), ip) == 0)
return tmp_nodes;
}
View
3 gui/win32/Main/TrayIcon.h
@@ -12,8 +12,7 @@ class TrayIcon {
static TrayIcon *getInstance() {
return instance;
- }
- enum status { CONNECTED, ON, OFF };
+ } enum status { CONNECTED, ON, OFF };
void setStatus(status con_status, const char *message);
View
3 lib/arprefresh/src/olsrd_arprefresh.h
@@ -38,8 +38,7 @@
#include "plugin_util.h"
int olsrd_plugin_init(void);
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
int olsrd_plugin_interface_version(void);
#endif
View
6 lib/bmf/src/Bmf.c
@@ -271,8 +271,7 @@ BmfPacketCaptured(struct TBmfInterface *intf, unsigned char sllPkttype, unsigned
dst.v4 = ipHeader->ip_dst;
/* Only forward multicast packets. If configured, also forward local broadcast packets */
- if (IsMulticast(&dst)
- || (EnableLocalBroadcast != 0 && ipequal(&dst, &intf->broadAddr))) {
+ if (IsMulticast(&dst) || (EnableLocalBroadcast != 0 && ipequal(&dst, &intf->broadAddr))) {
/* continue */
} else {
return;
@@ -775,8 +774,7 @@ BmfTunPacketCaptured(unsigned char *encapsulationUdpData)
broadAddr.v4.s_addr = htonl(EtherTunTapIpBroadcast);
/* Only forward multicast packets. If configured, also forward local broadcast packets */
- if (IsMulticast(&dstIp)
- || (EnableLocalBroadcast != 0 && ipequal(&dstIp, &broadAddr))) {
+ if (IsMulticast(&dstIp) || (EnableLocalBroadcast != 0 && ipequal(&dstIp, &broadAddr))) {
/* continue */
} else {
return;
View
3 lib/bmf/src/Bmf.h
@@ -60,8 +60,7 @@ struct interface;
extern int FanOutLimit;
extern int BroadcastRetransmitCount;
-void BmfPError(const char *format, ...)
- __attribute__ ((format(printf, 1, 2)));
+void BmfPError(const char *format, ...) __attribute__ ((format(printf, 1, 2)));
union olsr_ip_addr *MainAddressOf(union olsr_ip_addr *ip);
int InterfaceChange(struct interface *interf, int action);
int SetFanOutLimit(const char *value, void *data, set_plugin_parameter_addon addon);
View
3 lib/dot_draw/src/olsrd_dot_draw.c
@@ -109,8 +109,7 @@ static void ipc_print_net(const union olsr_ip_addr *, const union olsr_ip_addr *
static void ipc_send(const char *, int);
-static void ipc_send_fmt(const char *format, ...)
- __attribute__ ((format(printf, 1, 2)));
+static void ipc_send_fmt(const char *format, ...) __attribute__ ((format(printf, 1, 2)));
#define ipc_send_str(data) ipc_send((data), strlen(data))
View
3 lib/dot_draw/src/olsrd_dot_draw.h
@@ -56,8 +56,7 @@ extern int ipc_port;
int olsrd_plugin_interface_version(void);
int olsrd_plugin_init(void);
void olsr_plugin_exit(void);
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
#endif
View
6 lib/dyn_gw/src/olsrd_dyn_gw.c
@@ -327,10 +327,8 @@ check_gw(union olsr_ip_addr *net, olsr_u8_t prefixlen, struct ping_list *the_pin
metric, refcnt, use, iface);
*/
- if ((iflags & RTF_UP) && (metric == 0) && (netmask == mask.v4.s_addr)
- && (dest_addr == net->v4.s_addr)) {
- if (((mask.v4.s_addr == INET_PREFIX)
- && (net->v4.s_addr == INET_NET)) && (!(iflags & RTF_GATEWAY))) {
+ if ((iflags & RTF_UP) && (metric == 0) && (netmask == mask.v4.s_addr) && (dest_addr == net->v4.s_addr)) {
+ if (((mask.v4.s_addr == INET_PREFIX) && (net->v4.s_addr == INET_NET)) && (!(iflags & RTF_GATEWAY))) {
fclose(fp);
return retval;
}
View
3 lib/dyn_gw/src/olsrd_dyn_gw.h
@@ -54,8 +54,7 @@ int olsrd_plugin_init(void);
int olsrd_plugin_interface_version(void);
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
#endif
View
3 lib/dyn_gw_plain/src/olsrd_dyn_gw_plain.c
@@ -145,8 +145,7 @@ check_gw(union olsr_ip_addr *net, union olsr_ip_addr *mask)
*/
if ( //(iflags & RTF_GATEWAY) &&
- (iflags & RTF_UP) && (metric == 0) && (netmask == mask->v4.s_addr)
- && (dest_addr == net->v4.s_addr)) {
+ (iflags & RTF_UP) && (metric == 0) && (netmask == mask->v4.s_addr) && (dest_addr == net->v4.s_addr)) {
olsr_printf(DEBUGLEV, "INTERNET GATEWAY VIA %s detected in routing table.\n", iface);
retval = 1;
}
View
6 lib/httpinfo/src/olsrd_httpinfo.c
@@ -201,8 +201,7 @@ static int curr_clients;
static int http_socket;
#if 0
-int netsprintf(char *str, const char *format, ...)
- __attribute__ ((format(printf, 2, 3)));
+int netsprintf(char *str, const char *format, ...) __attribute__ ((format(printf, 2, 3)));
static int netsprintf_direct = 0;
static int netsprintf_error = 0;
#define sprintf netsprintf
@@ -357,8 +356,7 @@ parse_http_request(int fd)
while ((r = recv(client_sockets[curr_clients], &req[c], 1, 0)) > 0 && (c < sizeof(req) - 1)) {
c++;
- if ((c > 3 && !strcmp(&req[c - 4], "\r\n\r\n"))
- || (c > 1 && !strcmp(&req[c - 2], "\n\n")))
+ if ((c > 3 && !strcmp(&req[c - 4], "\r\n\r\n")) || (c > 1 && !strcmp(&req[c - 2], "\n\n")))
break;
}
View
3 lib/httpinfo/src/olsrd_plugin.h
@@ -91,8 +91,7 @@ extern struct allowed_net *allowed_nets;
/* Initialization function */
int olsrd_plugin_init(void);
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
int olsrd_plugin_interface_version(void);
View
3 lib/nameservice/src/mapwrite.c
@@ -99,8 +99,7 @@ mapwrite_work(FILE * fmap)
if (!(ip4equal((struct in_addr *)&olsr_cnf->main_addr, &ifs->interf->int_addr.sin_addr))) {
if (0 >
fprintf(fmap, "Mid('%s','%s');\n", olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
- olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)
- &ifs->interf->int_addr.sin_addr))) {
+ olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)&ifs->interf->int_addr.sin_addr))) {
return;
}
}
View
3 lib/nameservice/src/nameservice.c
@@ -1457,8 +1457,7 @@ allowed_hostname_or_ip_in_service(const char *service_line, const regmatch_t * h
hostname_or_ip = strndup(&service_line[hostname_or_ip_match->rm_so], hostname_or_ip_match->rm_eo - hostname_or_ip_match->rm_so);
//hostname is one of the names, that I announce (i.e. one that i am allowed to announce)
for (name = my_names; name != NULL; name = name->next) {
- if (strncmp(name->name, hostname_or_ip, name->len - strlen(my_suffix))
- == 0) {
+ if (strncmp(name->name, hostname_or_ip, name->len - strlen(my_suffix)) == 0) {
OLSR_PRINTF(4, "NAME PLUGIN: hostname %s in service %s is OK\n", hostname_or_ip, service_line);
free(hostname_or_ip);
hostname_or_ip = NULL;
View
3 lib/nameservice/src/nameservice.h
@@ -131,8 +131,7 @@ int encap_namemsg(struct namemsg *);
struct name_entry *add_name_to_list(struct name_entry *my_list, const char *value, int type, const union olsr_ip_addr *ip);
-struct name_entry *remove_nonvalid_names_from_list(struct name_entry
- *my_list, int type);
+struct name_entry *remove_nonvalid_names_from_list(struct name_entry *my_list, int type);
void free_all_list_entries(struct list_node *);
View
3 lib/pgraph/src/olsrd_pgraph.h
@@ -70,8 +70,7 @@
#include "mid_set.h"
#include "link_set.h"
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
int olsrd_plugin_interface_version(void);
View
6 lib/secure/src/olsrd_secure.c
@@ -416,8 +416,7 @@ validate_packet(struct interface *olsr_if, const char *pck, int *size)
/* Sanity check first */
if ((sig->olsr_msgtype != MESSAGE_TYPE) || (sig->olsr_vtime != 0)
- || (sig->olsr_msgsize != ntohs(sizeof(struct s_olsrmsg)))
- || (sig->ttl != 1) || (sig->hopcnt != 0)) {
+ || (sig->olsr_msgsize != ntohs(sizeof(struct s_olsrmsg))) || (sig->ttl != 1) || (sig->hopcnt != 0)) {
olsr_printf(1, "[ENC]Packet not sane!\n");
return 0;
}
@@ -1055,8 +1054,7 @@ timeout_timestamps(void *foo __attribute__ ((unused)))
/*Traverse MID list */
while (tmp_list != &timestamps[index]) {
/*Check if the entry is timed out */
- if ((TIMED_OUT(tmp_list->valtime))
- && (TIMED_OUT(tmp_list->conftime))) {
+ if ((TIMED_OUT(tmp_list->valtime)) && (TIMED_OUT(tmp_list->conftime))) {
struct ipaddr_str buf;
entry_to_delete = tmp_list;
tmp_list = tmp_list->next;
View
9 lib/tas/src/http.c
@@ -1359,8 +1359,7 @@ serviceConn(struct connInfo *info)
debug(DEBUG_REQUEST, "user = %s, password = %s\n", tmp2, tmp2 + i);
- if ((confUser != NULL && strcmp(confUser, tmp2) != 0)
- || (confPassword != NULL && strcmp(confPassword, tmp2 + i) != 0)) {
+ if ((confUser != NULL && strcmp(confUser, tmp2) != 0) || (confPassword != NULL && strcmp(confPassword, tmp2 + i) != 0)) {
error("user authentication failed\n");
writeError(info, 401);
return 0;
@@ -1551,8 +1550,7 @@ serviceConn(struct connInfo *info)
currSess = info->newSess;
}
- if (runLua(&errMsg, info, confWorkDir, tmp2, argList, &currSess->data)
- < 0) {
+ if (runLua(&errMsg, info, confWorkDir, tmp2, argList, &currSess->data) < 0) {
error("cannot run %s\n", tmp2);
if (info->newSess != NULL) {
@@ -1701,8 +1699,7 @@ httpService(int freq)
while (i < numConn) {
if (((conn[i]->flags & FLAG_READ) != 0 && readConn(conn[i]) < 0)
- || ((conn[i]->flags & FLAG_WRITE) != 0 && writeConn(conn[i]) < 0)
- || serviceConn(conn[i]) < 0) {
+ || ((conn[i]->flags & FLAG_WRITE) != 0 && writeConn(conn[i]) < 0) || serviceConn(conn[i]) < 0) {
closeFile(conn[i]->sockId);
freeConnInfo(conn[i]);
View
6 lib/tas/src/lib.h
@@ -50,10 +50,8 @@
#define DEBUG_LUA 16
#define DEBUG_QUANTUM 32
-extern void error(const char *form, ...)
- __attribute__ ((format(printf, 1, 2)));
-extern void debug(int facility, const char *form, ...)
- __attribute__ ((format(printf, 2, 3)));
+extern void error(const char *form, ...) __attribute__ ((format(printf, 1, 2)));
+extern void debug(int facility, const char *form, ...) __attribute__ ((format(printf, 2, 3)));
extern char *strdupAdd(const char *string, int add);
extern char *myStrdup(const char *string);
extern void chomp(char *line, int len);
View
3 lib/tas/src/lua/lauxlib.c
@@ -63,8 +63,7 @@ luaL_typerror(lua_State * L, int narg, const char *tname)
luaL_argerror(L, narg, msg);
}
-static void tag_error(lua_State * L, int narg, int tag)
- __attribute__ ((noreturn));
+static void tag_error(lua_State * L, int narg, int tag) __attribute__ ((noreturn));
static void
tag_error(lua_State * L, int narg, int tag)
{
View
9 lib/tas/src/lua/lauxlib.h
@@ -24,10 +24,8 @@ typedef struct luaL_reg {
LUALIB_API void luaL_openlib(lua_State * L, const char *libname, const luaL_reg * l, int nup);
LUALIB_API int luaL_getmetafield(lua_State * L, int obj, const char *e);
LUALIB_API int luaL_callmeta(lua_State * L, int obj, const char *e);
-LUALIB_API int luaL_typerror(lua_State * L, int narg, const char *tname)
- __attribute__ ((noreturn));
-LUALIB_API int luaL_argerror(lua_State * L, int numarg, const char *extramsg)
- __attribute__ ((noreturn));
+LUALIB_API int luaL_typerror(lua_State * L, int narg, const char *tname) __attribute__ ((noreturn));
+LUALIB_API int luaL_argerror(lua_State * L, int numarg, const char *extramsg) __attribute__ ((noreturn));
LUALIB_API const char *luaL_checklstring(lua_State * L, int numArg, size_t * l);
LUALIB_API const char *luaL_optlstring(lua_State * L, int numArg, const char *def, size_t * l);
LUALIB_API lua_Number luaL_checknumber(lua_State * L, int numArg);
@@ -42,8 +40,7 @@ LUALIB_API void luaL_getmetatable(lua_State * L, const char *tname);
LUALIB_API void *luaL_checkudata(lua_State * L, int ud, const char *tname);
LUALIB_API void luaL_where(lua_State * L, int lvl);
-LUALIB_API int luaL_error(lua_State * L, const char *fmt, ...)
- __attribute__ ((noreturn));
+LUALIB_API int luaL_error(lua_State * L, const char *fmt, ...) __attribute__ ((noreturn));
LUALIB_API int luaL_findstring(const char *st, const char *const lst[]);
View
3 lib/tas/src/lua/lbaselib.c
@@ -632,8 +632,7 @@ static int
luaB_cocreate(lua_State * L)
{
lua_State *NL = lua_newthread(L);
- luaL_argcheck(L, lua_isfunction(L, 1)
- && !lua_iscfunction(L, 1), 1, "Lua function expected");
+ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, "Lua function expected");
lua_pushvalue(L, 1); /* move function to top */
lua_xmove(L, NL, 1); /* move function from L to NL */
return 1;
View
3 lib/tas/src/lua/lcode.c
@@ -516,8 +516,7 @@ static void
invertjump(FuncState * fs, expdesc * e)
{
Instruction *pc = getjumpcontrol(fs, e->info);
- lua_assert(testOpMode(GET_OPCODE(*pc), OpModeT)
- && GET_OPCODE(*pc) != OP_TEST);
+ lua_assert(testOpMode(GET_OPCODE(*pc), OpModeT) && GET_OPCODE(*pc) != OP_TEST);
SETARG_A(*pc, !(GETARG_A(*pc)));
}
View
15 lib/tas/src/lua/ldebug.h
@@ -16,16 +16,11 @@
#define resethookcount(L) (L->hookcount = L->basehookcount)
void luaG_inithooks(lua_State * L);
-void luaG_typeerror(lua_State * L, const TObject * o, const char *opname)
- __attribute__ ((noreturn));
-void luaG_concaterror(lua_State * L, StkId p1, StkId p2)
- __attribute__ ((noreturn));
-void luaG_aritherror(lua_State * L, const TObject * p1, const TObject * p2)
- __attribute__ ((noreturn));
-int luaG_ordererror(lua_State * L, const TObject * p1, const TObject * p2)
- __attribute__ ((noreturn));
-void luaG_runerror(lua_State * L, const char *fmt, ...)
- __attribute__ ((noreturn));
+void luaG_typeerror(lua_State * L, const TObject * o, const char *opname) __attribute__ ((noreturn));
+void luaG_concaterror(lua_State * L, StkId p1, StkId p2) __attribute__ ((noreturn));
+void luaG_aritherror(lua_State * L, const TObject * p1, const TObject * p2) __attribute__ ((noreturn));
+int luaG_ordererror(lua_State * L, const TObject * p1, const TObject * p2) __attribute__ ((noreturn));
+void luaG_runerror(lua_State * L, const char *fmt, ...) __attribute__ ((noreturn));
void luaG_errormsg(lua_State * L) __attribute__ ((noreturn));
int luaG_checkcode(const Proto * pt);
View
3 lib/tas/src/lua/lgc.c
@@ -420,8 +420,7 @@ static void
checkSizes(lua_State * L, size_t deadmem)
{
/* check size of string hash */
- if (G(L)->strt.nuse < cast(ls_nstr, G(L)->strt.size / 4)
- && G(L)->strt.size > MINSTRTABSIZE * 2)
+ if (G(L)->strt.nuse < cast(ls_nstr, G(L)->strt.size / 4) && G(L)->strt.size > MINSTRTABSIZE * 2)
luaS_resize(L, G(L)->strt.size / 2); /* table is too big */
/* check size of buffer */
if (luaZ_sizebuffer(&G(L)->buff) > LUA_MINBUFFER * 2) { /* buffer too big? */
View
6 lib/tas/src/lua/llex.c
@@ -21,10 +21,8 @@
#define next(LS) (LS->current = zgetc(LS->z))
-static void luaX_error(LexState * ls, const char *s, const char *token)
- __attribute__ ((noreturn));
-static void luaX_lexerror(LexState * ls, const char *s, int token)
- __attribute__ ((noreturn));
+static void luaX_error(LexState * ls, const char *s, const char *token) __attribute__ ((noreturn));
+static void luaX_lexerror(LexState * ls, const char *s, int token) __attribute__ ((noreturn));
/* ORDER RESERVED */
static const char *const token2string[] = {
View
3 lib/tas/src/lua/llex.h
@@ -61,8 +61,7 @@ void luaX_init(lua_State * L);
void luaX_setinput(lua_State * L, LexState * LS, ZIO * z, TString * source);
int luaX_lex(LexState * LS, SemInfo * seminfo);
void luaX_checklimit(LexState * ls, int val, int limit, const char *msg);
-void luaX_syntaxerror(LexState * ls, const char *s)
- __attribute__ ((noreturn));
+void luaX_syntaxerror(LexState * ls, const char *s) __attribute__ ((noreturn));
void luaX_errorline(LexState * ls, const char *s, const char *token, int line) __attribute__ ((noreturn));
const char *luaX_token2str(LexState * ls, int token);
View
3 lib/tas/src/lua/lparser.c
@@ -43,8 +43,7 @@ typedef struct BlockCnt {
*/
static void chunk(LexState * ls);
static void expr(LexState * ls, expdesc * v);
-static void error_expected(LexState * ls, int token)
- __attribute__ ((noreturn));
+static void error_expected(LexState * ls, int token) __attribute__ ((noreturn));
static void
next(LexState * ls)
View
6 lib/tas/src/lua/lstrlib.c
@@ -431,8 +431,7 @@ match(MatchState * ms, const char *s, const char *p)
luaL_error(ms->L, "missing `[' after `%%f' in pattern");
ep = luaI_classend(ms, p); /* points to what is next */
previous = (s == ms->src_init) ? '\0' : *(s - 1);
- if (matchbracketclass(uchar(previous), p, ep - 1)
- || !matchbracketclass(uchar(*s), p, ep - 1))
+ if (matchbracketclass(uchar(previous), p, ep - 1) || !matchbracketclass(uchar(*s), p, ep - 1))
return NULL;
p = ep;
goto init; /* else return match(ms, s, ep); */
@@ -675,8 +674,7 @@ str_gsub(lua_State * L)
int n = 0;
MatchState ms;
luaL_Buffer b;
- luaL_argcheck(L, lua_gettop(L) >= 3 && (lua_isstring(L, 3)
- || lua_isfunction(L, 3)), 3, "string or function expected");
+ luaL_argcheck(L, lua_gettop(L) >= 3 && (lua_isstring(L, 3) || lua_isfunction(L, 3)), 3, "string or function expected");
luaL_buffinit(L, &b);
ms.L = L;
ms.src_init = src;
View
12 lib/tas/src/lua/ltests.c
@@ -190,8 +190,7 @@ listcode(lua_State * L)
{
int pc;
Proto *p;
- luaL_argcheck(L, lua_isfunction(L, 1)
- && !lua_iscfunction(L, 1), 1, "Lua function expected");
+ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, "Lua function expected");
p = clvalue(func_at(L, 1))->l.p;
lua_newtable(L);
setnameval(L, "maxstack", p->maxstacksize);
@@ -210,8 +209,7 @@ listk(lua_State * L)
{
Proto *p;
int i;
- luaL_argcheck(L, lua_isfunction(L, 1)
- && !lua_iscfunction(L, 1), 1, "Lua function expected");
+ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, "Lua function expected");
p = clvalue(func_at(L, 1))->l.p;
lua_newtable(L);
for (i = 0; i < p->sizek; i++) {
@@ -229,8 +227,7 @@ listlocals(lua_State * L)
int pc = luaL_checkint(L, 2) - 1;
int i = 0;
const char *name;
- luaL_argcheck(L, lua_isfunction(L, 1)
- && !lua_iscfunction(L, 1), 1, "Lua function expected");
+ luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, "Lua function expected");
p = clvalue(func_at(L, 1))->l.p;
while ((name = luaF_getlocalname(p, ++i, pc)) != NULL)
lua_pushstring(L, name);
@@ -310,8 +307,7 @@ table_query(lua_State * L)
luaA_pushobject(L, &t->array[i]);
lua_pushnil(L);
} else if ((i -= t->sizearray) < sizenode(t)) {
- if (!ttisnil(gval(gnode(t, i))) || ttisnil(gkey(gnode(t, i)))
- || ttisnumber(gkey(gnode(t, i)))) {
+ if (!ttisnil(gval(gnode(t, i))) || ttisnil(gkey(gnode(t, i))) || ttisnumber(gkey(gnode(t, i)))) {
luaA_pushobject(L, gkey(gnode(t, i)));
} else
lua_pushstring(L, "<undef>");
View
6 lib/tas/src/lua/lvm.c
@@ -449,8 +449,7 @@ luaV_execute(lua_State * L)
for (;;) {
const Instruction i = *pc++;
StkId base, ra;
- if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT))
- && (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {
+ if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) {
traceexec(L);
if (L->ci->state & CI_YIELD) { /* did hook yield? */
L->ci->u.l.savedpc = pc - 1;
@@ -742,8 +741,7 @@ luaV_execute(lua_State * L)
return ra; /* no: return */
} else { /* yes: continue its execution */
int nresults;
- lua_assert(ttisfunction(ci->base - 1)
- && (ci->state & CI_SAVEDPC));
+ lua_assert(ttisfunction(ci->base - 1) && (ci->state & CI_SAVEDPC));
lua_assert(GET_OPCODE(*(ci->u.l.savedpc - 1)) == OP_CALL);
nresults = GETARG_C(*(ci->u.l.savedpc - 1)) - 1;
luaD_poscall(L, nresults, ra);
View
12 lib/txtinfo/src/olsrd_txtinfo.c
@@ -120,8 +120,7 @@ static void ipc_print_mid(void);
#define SIW_TOPO 6
#define SIW_NEIGHLINK 7
-static int ipc_sendf(const char *format, ...)
- __attribute__ ((format(printf, 1, 2)));
+static int ipc_sendf(const char *format, ...) __attribute__ ((format(printf, 1, 2)));
/**
*Do initialization here
@@ -267,8 +266,7 @@ ipc_action(int fd)
if (inet_ntop(olsr_cnf->ip_version, &sin6->sin6_addr, addr, INET6_ADDRSTRLEN) == NULL)
addr[0] = '\0';
/* Use in6addr_any (::) in olsr.conf to allow anybody. */
- if (!ip6equal(&in6addr_any, &ipc_accept_ip.v6)
- && !ip6equal(&sin6->sin6_addr, &ipc_accept_ip.v6)) {
+ if (!ip6equal(&in6addr_any, &ipc_accept_ip.v6) && !ip6equal(&sin6->sin6_addr, &ipc_accept_ip.v6)) {
olsr_printf(1, "(TXTINFO) From host(%s) not allowed!\n", addr);
close(ipc_connection);
return;
@@ -491,12 +489,10 @@ send_info(int send_what)
/* Print tables to IPC socket */
/* links + Neighbors */
- if ((send_what == SIW_ALL) || (send_what == SIW_NEIGHLINK)
- || (send_what == SIW_LINK))
+ if ((send_what == SIW_ALL) || (send_what == SIW_NEIGHLINK) || (send_what == SIW_LINK))
ipc_print_link();
- if ((send_what == SIW_ALL) || (send_what == SIW_NEIGHLINK)
- || (send_what == SIW_NEIGH))
+ if ((send_what == SIW_ALL) || (send_what == SIW_NEIGHLINK) || (send_what == SIW_NEIGH))
ipc_print_neigh();
/* topology */
View
3 lib/txtinfo/src/olsrd_txtinfo.h
@@ -58,8 +58,7 @@ extern int nompr;
int olsrd_plugin_interface_version(void);
int olsrd_plugin_init(void);
void olsr_plugin_exit(void);
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
#endif
View
12 src/bsd/net.c
@@ -359,8 +359,7 @@ getsocket(int bufspace, char *int_name __attribute__ ((unused)))
}
for (on = bufspace;; on -= 1024) {
- if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&on, sizeof(on))
- == 0)
+ if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&on, sizeof(on)) == 0)
break;
if (on <= 8 * 1024) {
perror("setsockopt");
@@ -405,8 +404,7 @@ getsocket6(int bufspace, char *int_name __attribute__ ((unused)))
}
for (on = bufspace;; on -= 1024) {
- if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&on, sizeof(on))
- == 0)
+ if (setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char *)&on, sizeof(on)) == 0)
break;
if (on <= 8 * 1024) {
perror("setsockopt");
@@ -433,8 +431,7 @@ getsocket6(int bufspace, char *int_name __attribute__ ((unused)))
return -1;
}
#elif defined IPV6_PKTINFO
- if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, (char *)&on, sizeof(on))
- < 0) {
+ if (setsockopt(sock, IPPROTO_IPV6, IPV6_PKTINFO, (char *)&on, sizeof(on)) < 0) {
perror("IPV6_PKTINFO failed");
close(sock);
return -1;
@@ -513,8 +510,7 @@ get_ipv6_address(char *ifname, struct sockaddr_in6 *saddr6, int scope_in)
}
for (ifa = ifap; ifa; ifa = ifa->ifa_next) {
- if ((ifa->ifa_addr->sa_family == AF_INET6)
- && (strcmp(ifa->ifa_name, ifname) == 0)) {
+ if ((ifa->ifa_addr->sa_family == AF_INET6) && (strcmp(ifa->ifa_name, ifname) == 0)) {
sin6 = (const struct sockaddr_in6 *)(ifa->ifa_addr);
if (IN6_IS_ADDR_LINKLOCAL(&sin6->sin6_addr))
continue;
View
6 src/build_msg.c
@@ -790,8 +790,7 @@ serialize_mid4(struct interface *ifp)
struct midaddr *addrs;
struct interface *ifs;
- if ((olsr_cnf->ip_version != AF_INET) || (!ifp)
- || (ifnet == NULL || ifnet->int_next == NULL))
+ if ((olsr_cnf->ip_version != AF_INET) || (!ifp) || (ifnet == NULL || ifnet->int_next == NULL))
return OLSR_FALSE;
remainsize = net_outbuffer_bytes_left(ifp);
@@ -881,8 +880,7 @@ serialize_mid6(struct interface *ifp)
//printf("\t\tGenerating mid on %s\n", ifn->int_name);
- if ((olsr_cnf->ip_version != AF_INET6) || (!ifp)
- || (ifnet == NULL || ifnet->int_next == NULL))
+ if ((olsr_cnf->ip_version != AF_INET6) || (!ifp) || (ifnet == NULL || ifnet->int_next == NULL))
return OLSR_FALSE;
remainsize = net_outbuffer_bytes_left(ifp);
View
27 src/fpm.c
@@ -103,10 +103,8 @@ fpm
fpmmul(fpm a, fpm b)
{
fpm r;
- assert((0 < (sfpm) a) != (0 < (sfpm) b)
- || ((double)(sfpm) a) * ((double)(sfpm) b) <= (double)FPM_INT_MAX);
- assert((0 < (sfpm) a) == (0 < (sfpm) b)
- || ((double)(sfpm) a) * ((double)(sfpm) b) >= (double)FPM_INT_MIN);
+ assert((0 < (sfpm) a) != (0 < (sfpm) b) || ((double)(sfpm) a) * ((double)(sfpm) b) <= (double)FPM_INT_MAX);
+ assert((0 < (sfpm) a) == (0 < (sfpm) b) || ((double)(sfpm) a) * ((double)(sfpm) b) >= (double)FPM_INT_MIN);
r = (fpm) fpmmul_def((sfpm) a, (sfpm) b);
return r;
}
@@ -115,8 +113,7 @@ fpm
fpmdiv(fpm a, fpm b)
{
fpm r;
- assert(FPM_INT_MIN <= ((long long)(sfpm) a << FPM_BIT)
- && ((long long)(sfpm) a << FPM_BIT) <= FPM_INT_MAX);
+ assert(FPM_INT_MIN <= ((long long)(sfpm) a << FPM_BIT) && ((long long)(sfpm) a << FPM_BIT) <= FPM_INT_MAX);
r = (fpm) fpmdiv_def((sfpm) a, (sfpm) b);
return r;
}
@@ -125,10 +122,8 @@ fpm
fpmimul(int a, fpm b)
{
fpm r;
- assert((0 < a) != (0 < (sfpm) b)
- || ((double)a * (double)(sfpm) b) <= (double)FPM_INT_MAX);
- assert((0 < a) == (0 < (sfpm) b)
- || ((double)a * (double)(sfpm) b) >= (double)FPM_INT_MIN);
+ assert((0 < a) != (0 < (sfpm) b) || ((double)a * (double)(sfpm) b) <= (double)FPM_INT_MAX);
+ assert((0 < a) == (0 < (sfpm) b) || ((double)a * (double)(sfpm) b) >= (double)FPM_INT_MIN);
r = (fpm) fpmimul_def(a, (sfpm) b);
return r;
}
@@ -137,10 +132,8 @@ fpm
fpmmuli(fpm a, int b)
{
fpm r;
- assert((0 < (sfpm) a) != (0 < b)
- || ((double)(sfpm) a * (double)b) <= (double)FPM_INT_MAX);
- assert((0 < (sfpm) a) == (0 < b)
- || ((double)(sfpm) a * (double)b) >= (double)FPM_INT_MIN);
+ assert((0 < (sfpm) a) != (0 < b) || ((double)(sfpm) a * (double)b) <= (double)FPM_INT_MAX);
+ assert((0 < (sfpm) a) == (0 < b) || ((double)(sfpm) a * (double)b) >= (double)FPM_INT_MIN);
r = (fpm) fpmmuli_def((sfpm) a, b);
return r;
}
@@ -158,10 +151,8 @@ fpm
fpmlmul(fpm a, fpm b)
{
fpm r;
- assert((0 < (sfpm) a) != (0 < (sfpm) b)
- || ((double)(sfpm) a * (double)(sfpm) b / FPM_NUM) <= (double)FPM_INT_MAX);
- assert((0 < (sfpm) a) == (0 < (sfpm) b)
- || ((double)(sfpm) a * (double)(sfpm) b / FPM_NUM) >= (double)FPM_INT_MIN);
+ assert((0 < (sfpm) a) != (0 < (sfpm) b) || ((double)(sfpm) a * (double)(sfpm) b / FPM_NUM) <= (double)FPM_INT_MAX);
+ assert((0 < (sfpm) a) == (0 < (sfpm) b) || ((double)(sfpm) a * (double)(sfpm) b / FPM_NUM) >= (double)FPM_INT_MIN);
r = (fpm) fpmlmul_def((sfpm) a, (sfpm) b);
return r;
}
View
3 src/ipcalc.c
@@ -126,8 +126,7 @@ const char *
olsr_ip_prefix_to_string(const struct olsr_ip_prefix *prefix)
{
/* We need for IPv6 an IP address + '/' + prefix and for IPv4 an IP address + '/' + a netmask */
- static char
- buf[MAX(INET6_ADDRSTRLEN + 1 + 3, INET_ADDRSTRLEN + 1 + INET_ADDRSTRLEN)];
+ static char buf[MAX(INET6_ADDRSTRLEN + 1 + 3, INET_ADDRSTRLEN + 1 + INET_ADDRSTRLEN)];
const char *rv;
if (olsr_cnf->ip_version == AF_INET) {
View
11 src/link_set.c
@@ -231,9 +231,7 @@ get_best_link_to_neighbor(const union olsr_ip_addr *remote)
* is this interface better than anything we had before ?
* use the requested remote interface address as a tie-breaker
*/
- if ((tmp_if->int_metric < curr_metric)
- || ((tmp_if->int_metric == curr_metric)
- && ipequal(&walker->local_iface_addr, remote))) {
+ if ((tmp_if->int_metric < curr_metric) || ((tmp_if->int_metric == curr_metric) && ipequal(&walker->local_iface_addr, remote))) {
/* memorize the interface's metric */
curr_metric = tmp_if->int_metric;
@@ -258,9 +256,7 @@ get_best_link_to_neighbor(const union olsr_ip_addr *remote)
* is this link better than anything we had before ?
* use the requested remote interface address as a tie-breaker.
*/
- if ((tmp_lc < curr_lcost)
- || ((tmp_lc == curr_lcost)
- && ipequal(&walker->local_iface_addr, remote))) {
+ if ((tmp_lc < curr_lcost) || ((tmp_lc == curr_lcost) && ipequal(&walker->local_iface_addr, remote))) {
/* memorize the link quality */
curr_lcost = tmp_lc;
@@ -311,8 +307,7 @@ set_loss_link_multiplier(struct link_entry *entry)
* use the default multiplier only if there isn't any entry that
* has a matching IP address.
*/
- if ((ipequal(&mult->addr, &null_addr) && val < 0.0)
- || ipequal(&mult->addr, &entry->neighbor_iface_addr)) {
+ if ((ipequal(&mult->addr, &null_addr) && val < 0.0) || ipequal(&mult->addr, &entry->neighbor_iface_addr)) {
val = mult->value;
}
}
View
3 src/linux/apm.c
@@ -119,8 +119,7 @@ apm_init(void)
method = -1;
OLSR_PRINTF(3, "Initializing APM\n");
- if ((((fd_index = acpi_probe()) >= 0) || ac_power_on)
- && apm_read_acpi(&ainfo))
+ if ((((fd_index = acpi_probe()) >= 0) || ac_power_on) && apm_read_acpi(&ainfo))
method = USE_ACPI;
else if (apm_read_apm(&ainfo))
method = USE_APM;
View
3 src/linux/kernel_routes.c
@@ -198,8 +198,7 @@ olsr_ioctl_add_route(const struct rt_entry *rt)
kernel_route.rt_dev = if_ifwithindex_name(rt->rt_best->rtp_nexthop.iif_index);
/* delete existing default route before ? */
- if ((olsr_cnf->del_gws) && (rt->rt_dst.prefix.v4.s_addr == INADDR_ANY)
- && (rt->rt_dst.prefix_len == INADDR_ANY)) {
+ if ((olsr_cnf->del_gws) && (rt->rt_dst.prefix.v4.s_addr == INADDR_ANY) && (rt->rt_dst.prefix_len == INADDR_ANY)) {
delete_all_inet_gws();
olsr_cnf->del_gws = OLSR_FALSE;
}
View
3 src/log.h
@@ -53,8 +53,7 @@
void olsr_openlog(const char *ident);
-void olsr_syslog(int level, const char *format, ...)
- __attribute__ ((format(printf, 2, 3)));
+void olsr_syslog(int level, const char *format, ...) __attribute__ ((format(printf, 2, 3)));
#endif
View
3 src/lq_plugin_default_ff.c
@@ -172,8 +172,7 @@ default_lq_calc_cost_ff(const void *ptr)
const struct default_lq_ff *lq = ptr;
olsr_linkcost cost;
- if (lq->valueLq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)
- || lq->valueNlq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)) {
+ if (lq->valueLq < (unsigned int)(255 * MINIMAL_USEFUL_LQ) || lq->valueNlq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)) {
return LINK_COST_BROKEN;
}
View
3 src/lq_plugin_default_fpm.c
@@ -95,8 +95,7 @@ default_lq_calc_cost_fpm(const void *ptr)
const struct default_lq_fpm *lq = ptr;
olsr_linkcost cost;
- if (lq->valueLq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)
- || lq->valueNlq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)) {
+ if (lq->valueLq < (unsigned int)(255 * MINIMAL_USEFUL_LQ) || lq->valueNlq < (unsigned int)(255 * MINIMAL_USEFUL_LQ)) {
return LINK_COST_BROKEN;
}
View
12 src/mpr.c
@@ -68,8 +68,7 @@ static int olsr_check_mpr_changes(void);
static int olsr_chosen_mpr(struct neighbor_entry *, olsr_u16_t *);
-static struct neighbor_2_list_entry
- *olsr_find_2_hop_neighbors_with_1_link(int);
+static struct neighbor_2_list_entry *olsr_find_2_hop_neighbors_with_1_link(int);
/* End:
* Prototypes for internal functions
@@ -220,8 +219,7 @@ olsr_find_maximum_covered(int willingness)
a_neighbor->neighbor_2_nocov, a_neighbor->is_mpr, a_neighbor->willingness, maximum);
#endif
- if ((!a_neighbor->is_mpr) && (a_neighbor->willingness == willingness)
- && (maximum < a_neighbor->neighbor_2_nocov)) {
+ if ((!a_neighbor->is_mpr) && (a_neighbor->willingness == willingness) && (maximum < a_neighbor->neighbor_2_nocov)) {
maximum = a_neighbor->neighbor_2_nocov;
mpr_candidate = a_neighbor;
@@ -368,8 +366,7 @@ add_will_always_nodes(void)
OLSR_FOR_ALL_NBR_ENTRIES(a_neighbor) {
struct ipaddr_str buf;
- if ((a_neighbor->status == NOT_SYM)
- || (a_neighbor->willingness != WILL_ALWAYS)) {
+ if ((a_neighbor->status == NOT_SYM) || (a_neighbor->willingness != WILL_ALWAYS)) {
continue;
}
olsr_chosen_mpr(a_neighbor, &count);
@@ -490,8 +487,7 @@ olsr_optimize_mpr_set(void)
dup_neighbor = olsr_lookup_neighbor_table(&two_hop_list->neighbor_2->neighbor_2_addr);
- if ((dup_neighbor != NULL)
- && (dup_neighbor->status != NOT_SYM)) {
+ if ((dup_neighbor != NULL) && (dup_neighbor->status != NOT_SYM)) {
continue;
}
//printf("\t[%s] coverage %d\n", olsr_ip_to_string(&buf, &two_hop_list->neighbor_2->neighbor_2_addr), two_hop_list->neighbor_2->mpr_covered_count);
View
13 src/neighbor_table.h
@@ -87,20 +87,15 @@ void olsr_init_neighbor_table(void);
int olsr_delete_neighbor_2_pointer(struct neighbor_entry *, union olsr_ip_addr *);
-struct neighbor_2_list_entry *olsr_lookup_my_neighbors(const struct
- neighbor_entry *, const union
- olsr_ip_addr *);
+struct neighbor_2_list_entry *olsr_lookup_my_neighbors(const struct neighbor_entry *, const union olsr_ip_addr *);
int olsr_delete_neighbor_table(const union olsr_ip_addr *);
-struct neighbor_entry *olsr_insert_neighbor_table(const union olsr_ip_addr
- *);
+struct neighbor_entry *olsr_insert_neighbor_table(const union olsr_ip_addr *);
-struct neighbor_entry *olsr_lookup_neighbor_table(const union olsr_ip_addr
- *);
+struct neighbor_entry *olsr_lookup_neighbor_table(const union olsr_ip_addr *);
-struct neighbor_entry *olsr_lookup_neighbor_table_alias(const union
- olsr_ip_addr *);
+struct neighbor_entry *olsr_lookup_neighbor_table_alias(const union olsr_ip_addr *);
void olsr_time_out_two_hop_neighbors(struct neighbor_entry *);
View
3 src/olsr.h
@@ -82,8 +82,7 @@ void olsr_exit(const char *, int);
void *olsr_malloc(size_t, const char *);
-int olsr_printf(int, const char *, ...)
- __attribute__ ((format(printf, 2, 3)));
+int olsr_printf(int, const char *, ...) __attribute__ ((format(printf, 2, 3)));
void olsr_trigger_forced_update(void *);
View
6 src/olsr_cookie.c
@@ -278,8 +278,7 @@ olsr_cookie_free(struct olsr_cookie_info *ci, void *ptr)
* Verify if there has been a memory overrun, or
* the wrong owner is trying to free this.
*/
- assert(!memcmp(&branding->cmb_sig, "cookie", 6)
- && branding->cmb_id == ci->ci_id);
+ assert(!memcmp(&branding->cmb_sig, "cookie", 6) && branding->cmb_id == ci->ci_id);
/* Kill the brand */
memset(branding, 0, sizeof(*branding));
@@ -289,8 +288,7 @@ olsr_cookie_free(struct olsr_cookie_info *ci, void *ptr)
* point. Keep at least ten percent of the active used blocks or at least
* ten blocks on the free list.
*/
- if ((ci->ci_free_list_usage < COOKIE_FREE_LIST_THRESHOLD)
- || (ci->ci_free_list_usage < ci->ci_usage / COOKIE_FREE_LIST_THRESHOLD)) {
+ if ((ci->ci_free_list_usage < COOKIE_FREE_LIST_THRESHOLD) || (ci->ci_free_list_usage < ci->ci_usage / COOKIE_FREE_LIST_THRESHOLD)) {
free_list_node = (struct list_node *)ptr;
list_node_init(free_list_node);
View
6 src/olsr_switch/main.c
@@ -239,8 +239,7 @@ ohs_route_data(struct ohs_connection *oc)
/* Loop trough clients */
for (ohs_cs = ohs_conns; ohs_cs; ohs_cs = ohs_cs->next) {
/* Check that the link is active open */
- if (ohs_check_link(oc, &ohs_cs->ip_addr)
- && oc->socket != ohs_cs->socket) {
+ if (ohs_check_link(oc, &ohs_cs->ip_addr) && oc->socket != ohs_cs->socket) {
ssize_t sent;
/* Send link addr */
@@ -425,8 +424,7 @@ ohs_listen_loop(void)
while (1) {
for (Walker = ohs_conns; Walker != NULL; Walker = Walker->next) {
- if (WSAEventSelect(Walker->socket, Objects[1], FD_READ | FD_CLOSE)
- == SOCKET_ERROR) {
+ if (WSAEventSelect(Walker->socket, Objects[1], FD_READ | FD_CLOSE) == SOCKET_ERROR) {
fprintf(stderr, "WSAEventSelect failed (2): %s\n", strerror(errno));
Sleep(1000);
continue;
View
4 src/olsr_switch/ohs_cmd.c
@@ -420,9 +420,7 @@ ohs_cmd_log(const char *args)
args += get_next_token(args, tok_buf, TOK_BUF_SIZE);
- if (strlen(tok_buf)
- && ((set = !strncmp(tok_buf, "set", strlen("set")))
- || !strncmp(tok_buf, "unset", strlen("unset")))) {
+ if (strlen(tok_buf) && ((set = !strncmp(tok_buf, "set", strlen("set"))) || !strncmp(tok_buf, "unset", strlen("unset")))) {
olsr_u32_t new_bit = 0;
args += get_next_token(args, tok_buf, TOK_BUF_SIZE);
View
3 src/olsrd_plugin.h
@@ -92,8 +92,7 @@ struct olsrd_plugin_parameters {
/**
* Delivers the (address of the) table and the size of the parameter description
*/
-void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters
- **params, int *size);
+void olsrd_get_plugin_parameters(const struct olsrd_plugin_parameters **params, int *size);
#endif
View
3 src/packet.c
@@ -352,8 +352,7 @@ olsr_build_tc_packet(struct tc_message *message)
case (1):
{
/* 1 = Add all MPR selectors and selected MPRs */
- if ((entry->is_mpr)
- || (olsr_lookup_mprs_set(&entry->neighbor_main_addr) != NULL)) {
+ if ((entry->is_mpr) || (olsr_lookup_mprs_set(&entry->neighbor_main_addr) != NULL)) {
//printf("\t%s\n", olsr_ip_to_string(&mprs->mpr_selector_addr));
message_mpr = olsr_malloc_tc_mpr_addr("Build TC 2");
View
9 src/parser.c
@@ -380,8 +380,7 @@ parse_packet(struct olsr *olsr, int size, struct interface *in_if, union olsr_ip
/* Should be the same for IPv4 and IPv6 */
/* Promiscuous or exact match */
- if ((entry->type == PROMISCUOUS)
- || (entry->type == m->v4.olsr_msgtype)) {
+ if ((entry->type == PROMISCUOUS) || (entry->type == m->v4.olsr_msgtype)) {
entry->function(m, in_if, from_addr);
processed = 1;
}
@@ -459,11 +458,9 @@ olsr_input(int fd)
&((struct sockaddr_in *)&from)->sin_addr.s_addr));
#endif
- if ((olsr_cnf->ip_version == AF_INET)
- && (fromlen != sizeof(struct sockaddr_in)))
+ if ((olsr_cnf->ip_version == AF_INET) && (fromlen != sizeof(struct sockaddr_in)))
break;
- else if ((olsr_cnf->ip_version == AF_INET6)
- && (fromlen != sizeof(struct sockaddr_in6)))
+ else if ((olsr_cnf->ip_version == AF_INET6) && (fromlen != sizeof(struct sockaddr_in6)))
break;
/* are we talking to ourselves? */
View
3 src/plugin_loader.c
@@ -252,8 +252,7 @@ init_olsr_plugin(struct olsr_plugin *entry)
unsigned int i;
int rc = 0;
for (i = 0; i < entry->plugin_parameters_size; i++) {
- if (0 == entry->plugin_parameters[i].name[0]
- || 0 == strcasecmp(entry->plugin_parameters[i].name, params->key)) {
+ if (0 == entry->plugin_parameters[i].name[0] || 0 == strcasecmp(entry->plugin_parameters[i].name, params->key)) {
/* we have found it! */
rc =
entry->plugin_parameters[i].set_plugin_parameter(params->value, entry->plugin_parameters[i].data,
View
6 src/process_package.c
@@ -97,8 +97,7 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
message_neighbors->address = *neigh_addr;
}
- if (((message_neighbors->status == SYM_NEIGH)
- || (message_neighbors->status == MPR_NEIGH))) {
+ if (((message_neighbors->status == SYM_NEIGH) || (message_neighbors->status == MPR_NEIGH))) {
struct neighbor_2_list_entry *two_hop_neighbor_yet = olsr_lookup_my_neighbors(neighbor, &message_neighbors->address);
#ifdef DEBUG
OLSR_PRINTF(7, "\tProcessing %s\n", olsr_ip_to_string(&buf, &message_neighbors->address));
@@ -195,8 +194,7 @@ process_message_neighbors(struct neighbor_entry *neighbor, const struct hello_me
if (if_ifwithaddr(&message_neighbors->address) != NULL)
continue;
- if (((message_neighbors->status == SYM_NEIGH)
- || (message_neighbors->status == MPR_NEIGH))) {
+ if (((message_neighbors->status == SYM_NEIGH) || (message_neighbors->status == MPR_NEIGH))) {
struct neighbor_list_entry *walker;
struct neighbor_2_entry *two_hop_neighbor;
struct neighbor_2_list_entry *two_hop_neighbor_yet = olsr_lookup_my_neighbors(neighbor,
View
6 src/routing_table.c
@@ -377,8 +377,7 @@ olsr_delete_rt_path(struct rt_path *rtp)
olsr_bool
olsr_nh_change(const struct rt_nexthop *nh1, const struct rt_nexthop *nh2)
{
- if (!ipequal(&nh1->gateway, &nh2->gateway)
- || (nh1->iif_index != nh2->iif_index)) {
+ if (!ipequal(&nh1->gateway, &nh2->gateway) || (nh1->iif_index != nh2->iif_index)) {
return OLSR_TRUE;
}
return OLSR_FALSE;
@@ -455,8 +454,7 @@ olsr_cmp_rtp(const struct rt_path *rtp1, const struct rt_path *rtp2, const struc
/* originator (which is guaranteed to be unique) is final tie breaker */
if ((rtp1->rtp_metric.hops == rtp2->rtp_metric.hops)
- && (memcmp(&rtp1->rtp_originator, &rtp2->rtp_originator, olsr_cnf->ipsize)
- == -1)) {
+ && (memcmp(&rtp1->rtp_originator, &rtp2->rtp_originator, olsr_cnf->ipsize) == -1)) {
return OLSR_TRUE;
}
View
7 src/two_hop_neighbor_table.h
@@ -77,12 +77,9 @@ void olsr_delete_two_hop_neighbor_table(struct neighbor_2_entry *);
void olsr_insert_two_hop_neighbor_table(struct neighbor_2_entry *);
-struct neighbor_2_entry *olsr_lookup_two_hop_neighbor_table(const union
- olsr_ip_addr *);
+struct neighbor_2_entry *olsr_lookup_two_hop_neighbor_table(const union olsr_ip_addr *);
-struct neighbor_2_entry *olsr_lookup_two_hop_neighbor_table_mid(const union
- olsr_ip_addr
- *);
+struct neighbor_2_entry *olsr_lookup_two_hop_neighbor_table_mid(const union olsr_ip_addr *);
void olsr_print_two_hop_neighbor_table(void);
View
3 src/unix/ifnet.c
@@ -299,8 +299,7 @@ chk_if_changed(struct olsr_if *iface)
ifp->int_addr = *(struct sockaddr_in *)&ifr.ifr_addr;
- if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize)
- == 0) {
+ if (memcmp(&olsr_cnf->main_addr, &ifp->ip_addr, olsr_cnf->ipsize) == 0) {
OLSR_PRINTF(1, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
olsr_syslog(OLSR_LOG_INFO, "New main address: %s\n", sockaddr4_to_string(&buf, &ifr.ifr_addr));
memcpy(&olsr_cnf->main_addr, &((struct sockaddr_in *)&ifr.ifr_addr)->sin_addr.s_addr, olsr_cnf->ipsize);
View
3 src/win32/compat.c
@@ -327,8 +327,7 @@ inet_pton6(const char *src, unsigned char *dst)
continue;
}
- if (ch == '.' && ((tp + NS_INADDRSZ) <= endp)
- && inet_pton4(curtok, tp) > 0) {
+ if (ch == '.' && ((tp + NS_INADDRSZ) <= endp) && inet_pton4(curtok, tp) > 0) {
tp += NS_INADDRSZ;
saw_xdigit = 0;
break;
View
6 src/win32/ifnet.c
@@ -160,8 +160,7 @@ IntNameToMiniIndex(int *MiniIndex, char *String)
int i, k;
char ch;
- if ((String[0] != 'i' && String[0] != 'I')
- || (String[1] != 'f' && String[1] != 'F'))
+ if ((String[0] != 'i' && String[0] != 'I') || (String[1] != 'f' && String[1] != 'F'))
return -1;
*MiniIndex = 0;
@@ -256,8 +255,7 @@ GetIntInfo(struct InterfaceInfo *Info, char *Name)
return -1;
}
- if ((Name[0] != 'i' && Name[0] != 'I')
- || (Name[1] != 'f' && Name[1] != 'F')) {
+ if ((Name[0] != 'i' && Name[0] != 'I') || (Name[1] != 'f' && Name[1] != 'F')) {
if (FriendlyNameToMiniIndex(&MiniIndex, Name) < 0) {
fprintf(stderr, "No such interface: %s!\n", Name);
return -1;
View
3 src/win32/net.c
@@ -249,8 +249,7 @@ disable_ip_forwarding(int Ver)
if (Lib == NULL)
return 0;
- UnenableRouter = (unsigned int __stdcall(*)(OVERLAPPED *, unsigned int *))
- GetProcAddress(Lib, WIDE_STRING("UnenableRouter"));
+ UnenableRouter = (unsigned int __stdcall(*)(OVERLAPPED *, unsigned int *))GetProcAddress(Lib, WIDE_STRING("UnenableRouter"));
if (UnenableRouter == NULL)
return 0;

0 comments on commit 7c975b3

Please sign in to comment.
Something went wrong with that request. Please try again.