Changeset 32682


Ignore:
Timestamp:
Jul 13, 2017, 8:29:14 AM (2 weeks ago)
Author:
brainslayer
Message:

resolve some warnings

Location:
src/router
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • src/router/libutils/bcmutils.c

    r32677 r32682  
    11// #define CDEBUG
     2#include <sys/sysinfo.h>
    23
    34#include <stdio.h>
  • src/router/libutils/country.c

    r32386 r32682  
    912912}
    913913
    914 char *getIsoName(const char *country)
     914const char *getIsoName(const char *country)
    915915{
    916916        int i;
     
    922922}
    923923
    924 char *getCountryByIso(const char *country)
     924const char *getCountryByIso(const char *country)
    925925{
    926926        int i;
  • src/router/libutils/mac80211autochannel.c

    r32424 r32682  
    417417                bw = 40;
    418418
    419         char *country = getIsoName(nvram_default_get("ath0_regdomain", "UNITED_STATES"));
     419        const char *country = getIsoName(nvram_default_get("ath0_regdomain", "UNITED_STATES"));
    420420        if (!country)
    421421                country = "DE";
  • src/router/libutils/mac80211info.c

    r32677 r32682  
    757757}
    758758
    759 #ifdef HAVE_MVEBU
    760 static int is_wrt3200()
    761 {
    762         FILE *fp = fopen("/proc/device-tree/model", "r");
    763         if (fp) {
    764                 char modelstr[32];
    765                 fread(modelstr, 1, 31, fp);
    766                 if (strstr(modelstr, "WRT3200ACM")) {
    767                         fclose(fp);
    768                         return 1;
    769                 }
    770                 fclose(fp);
    771         }
    772         return 0;
    773 }
    774 #endif
    775 
    776759#ifdef HAVE_ATH10K
    777760
     
    11591142};
    11601143
    1161 struct wifi_channels *mac80211_get_channels(char *interface, char *country, int max_bandwidth_khz, unsigned char checkband)
     1144struct wifi_channels *mac80211_get_channels(char *interface, const char *country, int max_bandwidth_khz, unsigned char checkband)
    11621145{
    11631146        struct nlattr *tb[NL80211_FREQUENCY_ATTR_MAX + 1];
  • src/router/libutils/mac80211regulatory.c

    r32386 r32682  
    3939#include <sys/stat.h>
    4040#include <fcntl.h>
     41#include <unistd.h>
    4142#include <arpa/inet.h>
    4243#include "mac80211regulatory.h"
     
    107108}
    108109
    109 struct ieee80211_regdomain *mac80211_get_regdomain(char *varcountry)
     110struct ieee80211_regdomain *mac80211_get_regdomain(const char *varcountry)
    110111{
    111112        int fd = -1;
  • src/router/libutils/mac80211regulatory.h

    r24572 r32682  
    239239struct ieee80211_regdomain *country2rd(__u8 *db, int dblen, struct regdb_file_reg_country *country);
    240240
    241 struct ieee80211_regdomain *mac80211_get_regdomain(char *varcountry);
     241struct ieee80211_regdomain *mac80211_get_regdomain(const char *varcountry);
  • src/router/libutils/sha1.c

    r23520 r32682  
    2020#include <stdint.h>
    2121#include <string.h>
     22#include <netinet/in.h>
    2223
    2324typedef unsigned int uint32_t;
  • src/router/libutils/shutils.c

    r32490 r32682  
    152152int eval_va(const char *cmd, ...)
    153153{
    154         char *s_args[128];
     154        const char *s_args[128];
    155155        va_list args;
    156156        va_start(args, (char *)cmd);
     
    170170int eval_va_silence(const char *cmd, ...)
    171171{
    172         char *s_args[128];
     172        const char *s_args[128];
    173173        va_list args;
    174174        va_start(args, (char *)cmd);
     
    187187
    188188// FILE *debugfp=NULL;
    189 int _evalpid(char *const argv[], char *path, int timeout, int *ppid)
     189int _evalpid(char * const argv[], char *path, int timeout, int *ppid)
    190190{
    191191        pid_t pid;
  • src/router/libutils/utils.c

    r32673 r32682  
    71177117        wordlist = module;
    71187118        foreach(word, wordlist, next) {
    7119                 ret |= _evalpid((char *[]) {
     7119                ret |= _evalpid((char * const[]) {
    71207120                                "insmod", word, NULL}, ">/dev/null", 0, NULL);
    71217121        }
     
    71297129        wordlist = module;
    71307130        foreach(word, wordlist, next) {
    7131                 _evalpid((char *[]) {
     7131                _evalpid((char *const[]) {
    71327132                         "rmmod", word, NULL}, ">/dev/null", 0, NULL);
    71337133        }
  • src/router/libutils/wl.c

    r32677 r32682  
    6363        return (freq - 5000) / 5;
    6464}
     65#ifdef HAVE_MVEBU
     66int is_wrt3200()
     67{
     68        FILE *fp = fopen("/proc/device-tree/model", "r");
     69        if (fp) {
     70                char modelstr[32];
     71                fread(modelstr, 1, 31, fp);
     72                if (strstr(modelstr, "WRT3200ACM")) {
     73                        fclose(fp);
     74                        return 1;
     75                }
     76                fclose(fp);
     77        }
     78        return 0;
     79}
     80#endif
    6581
    6682#ifdef HAVE_MADWIFI
     
    7086        sscanf(prefix, "ath%d", &devnum);
    7187#ifdef HAVE_MVEBU
    72 //      fprintf(stderr, "is mvebu %d\n",is_mvebu(prefix));
    7388        if (is_wrt3200() && is_mvebu(prefix) && !strncmp(prefix, "ath0", 4))
    7489                return 0;
  • src/router/shared/shutils.h

    r32202 r32682  
    5252 */
    5353
    54 int _evalpid(char *const argv[], char *path, int timeout, int *ppid);
     54int _evalpid(char * const argv[], char *path, int timeout, int *ppid);
    5555
    5656//extern int _eval(char *const argv[]);
  • src/router/shared/utils.h

    r32603 r32682  
    11631163u_int64_t freediskSpace(char *path);
    11641164
    1165 char *getIsoName(const char *country);
     1165const char *getIsoName(const char *country);
    11661166int has_gateway(void);          // return 1 if nat/gateway mode is enabled for wan
    11671167#if defined(HAVE_RT2880) || defined(HAVE_RT61)
  • src/router/shared/wlutils.h

    r31932 r32682  
    113113extern int has_athmask(int devnum, int mask);
    114114extern int has_2ghz(char *prefix);
     115extern int is_wrt3200(void);
    115116extern int has_5ghz(char *prefix);
    116117extern int has_ht40(char *prefix);
     
    172173#endif
    173174extern int mac80211_check_band(char *interface, int checkband);
    174 struct wifi_channels *mac80211_get_channels(char *interface, char *country, int max_bandwidth_khz, unsigned char checkband);
     175struct wifi_channels *mac80211_get_channels(char *interface, const char *country, int max_bandwidth_khz, unsigned char checkband);
    175176#define AUTO_FORCEHT40 1
    176177#define AUTO_FORCEVHT80 2
     
    271272unsigned int getRegDomain(const char *country);
    272273unsigned int getCountry(const char *country);
    273 char *getCountryByIso(const char *iso);
     274const char *getCountryByIso(const char *iso);
    274275char *getCountryList(void);
    275276
Note: See TracChangeset for help on using the changeset viewer.