{
char tmp[10];
- if (snprintf(buf, sizeof(tmp), "%hd", i)) {
+ if (snprintf(buf, sizeof(tmp), "%hd", (short)i)) {
/* This shitty string needs to be converted to UTF-8 */
snprintf(tmp, sizeof(tmp), "%s", g_locale_to_utf8(buf, -1, NULL, NULL, NULL));
strcpy(buf, tmp);
/* Create socket for capturing and sending of multicast packets on
* non-OLSR interfaces, and on OLSR-interfaces if configured. */
- if ((olsrIntf == NULL)) {
+ if (!olsrIntf) {
capturingSkfd = CreateCaptureSocket(ifName);
electionSkfd = CreateRouterElectionSocket(ifName);
helloSkfd = CreateHelloSocket(ifName);
/* Create socket for capturing and sending of multicast packets on
* non-OLSR interfaces, and on OLSR-interfaces if configured. */
- if ((olsrIntf == NULL)) {
+ if (!olsrIntf) {
capturingSkfd = CreateCaptureSocket(ifName);
if (capturingSkfd < 0) {
free(newIf);
#include <stdint.h>
#include <stdlib.h>
#include <time.h>
+#include <math.h>
#define NMEA_RANDOM_MAX INT32_MAX
static inline long int nmea_random(const double min, const double max) {
int32_t value;
int randomFile;
- double range = abs(max - min);
+ double range = fabs(max - min);
#ifdef _WIN32
value = random();
*
*@param signo the signal that triggered this callback
*/
+__attribute__ ((noreturn))
static void olsr_reconfigure(int signo __attribute__ ((unused))) {
#ifndef _WIN32
int errNr = errno;
*
* @param signo the signal that triggered this call
*/
+__attribute__ ((noreturn))
#ifdef _WIN32
int __stdcall
SignalHandler(unsigned long signo)
while (the_one_hop_list != &second_hop_entries->neighbor_2->neighbor_2_nblist) {
- if ((the_one_hop_list->neighbor->status == SYM)) {
+ if (the_one_hop_list->neighbor->status == SYM) {
if (second_hop_entries->neighbor_2->mpr_covered_count >= olsr_cnf->mpr_coverage) {
the_one_hop_list->neighbor->neighbor_2_nocov--;
}
OLSR_PRINTF(1, "Validation of address %s failed!\n", olsr_ip_to_string(&buf, adr));
return false;
}
- if (deny_entry == (struct deny_address_entry *)&olsr_cnf->main_addr)
+ if (&deny_entry->addr == &olsr_cnf->main_addr)
break;
}
return true;