Skip to content

Commit

Permalink
[Utils] Make member function 'Foo::Bar' static.
Browse files Browse the repository at this point in the history
  • Loading branch information
ace20022 committed Jun 10, 2014
1 parent 658e9d0 commit e92e64c
Show file tree
Hide file tree
Showing 16 changed files with 53 additions and 53 deletions.
14 changes: 7 additions & 7 deletions xbmc/utils/BitstreamConverter.h
Expand Up @@ -136,12 +136,12 @@ class CBitstreamParser
CBitstreamParser();
~CBitstreamParser();

bool Open();
void Close();
bool FindIdrSlice(const uint8_t *buf, int buf_size);
static bool Open();
static void Close();
static bool FindIdrSlice(const uint8_t *buf, int buf_size);

protected:
const uint8_t* find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
static const uint8_t* find_start_code(const uint8_t *p, const uint8_t *end, uint32_t *state);
};

class CBitstreamConverter
Expand Down Expand Up @@ -173,13 +173,13 @@ class CBitstreamConverter
static bool mpeg2_sequence_header(const uint8_t *data, const uint32_t size, mpeg2_sequence *sequence);

protected:
const int avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size);
const int avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size);
static const int avc_parse_nal_units(AVIOContext *pb, const uint8_t *buf_in, int size);
static const int avc_parse_nal_units_buf(const uint8_t *buf_in, uint8_t **buf, int *size);
const int isom_write_avcc(AVIOContext *pb, const uint8_t *data, int len);
// bitstream to bytestream (Annex B) conversion support.
bool BitstreamConvertInit(void *in_extradata, int in_extrasize);
bool BitstreamConvert(uint8_t* pData, int iSize, uint8_t **poutbuf, int *poutbuf_size);
void BitstreamAllocAndCopy(uint8_t **poutbuf, int *poutbuf_size,
static void BitstreamAllocAndCopy(uint8_t **poutbuf, int *poutbuf_size,
const uint8_t *sps_pps, uint32_t sps_pps_size, const uint8_t *in, uint32_t in_size);

typedef struct omx_bitstream_ctx {
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/CPUInfo.h
Expand Up @@ -104,7 +104,7 @@ class CCPUInfo
bool readProcStat(unsigned long long& user, unsigned long long& nice, unsigned long long& system,
unsigned long long& idle, unsigned long long& io);
void ReadCPUFeatures();
bool HasNeon();
static bool HasNeon();

#ifdef TARGET_POSIX
FILE* m_fProcStat;
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/Fanart.h
Expand Up @@ -102,7 +102,7 @@ class CFanart
/// \param colorsIn: CStdString containing a string of colors in some format to be converted
/// \param colorsOut: XBMC ARGB Hexadecimal string comma seperated "FFFFFFFF,DDDDDDDD,AAAAAAAA"
/// \return boolean indicating success or failure.
bool ParseColors(const CStdString &colorsIn, CStdString &colorsOut);
static bool ParseColors(const CStdString &colorsIn, CStdString &colorsOut);

struct SFanartData
{
Expand Down
4 changes: 2 additions & 2 deletions xbmc/utils/HTMLUtil.cpp
Expand Up @@ -31,7 +31,7 @@ CHTMLUtil::CHTMLUtil(void)
CHTMLUtil::~CHTMLUtil(void)
{}

int CHTMLUtil::FindTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos) const
int CHTMLUtil::FindTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos)
{
CStdString strHTMLLow = strHTML;
CStdString strTagLow = strTag;
Expand All @@ -51,7 +51,7 @@ int CHTMLUtil::FindTag(const CStdString& strHTML, const CStdString& strTag, CStd
return iStart;
}

int CHTMLUtil::FindClosingTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos) const
int CHTMLUtil::FindClosingTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos)
{
CStdString strHTMLLow = strHTML;
CStdString strTagLow = strTag;
Expand Down
8 changes: 4 additions & 4 deletions xbmc/utils/HTMLUtil.h
Expand Up @@ -29,10 +29,10 @@ class CHTMLUtil
public:
CHTMLUtil(void);
virtual ~CHTMLUtil(void);
int FindTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos = 0) const;
int FindClosingTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos) const;
void getValueOfTag(const CStdString& strTagAndValue, CStdString& strValue);
void getAttributeOfTag(const CStdString& strTagAndValue, const CStdString& strTag, CStdString& strValue);
static int FindTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos = 0);
static int FindClosingTag(const CStdString& strHTML, const CStdString& strTag, CStdString& strtagFound, int iPos);
static void getValueOfTag(const CStdString& strTagAndValue, CStdString& strValue);
static void getAttributeOfTag(const CStdString& strTagAndValue, const CStdString& strTag, CStdString& strValue);
static void RemoveTags(CStdString& strHTML);
static void ConvertHTMLToW(const CStdStringW& strHTML, CStdStringW& strStripped);
};
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/JobManager.cpp
Expand Up @@ -425,7 +425,7 @@ void CJobManager::RemoveWorker(const CJobWorker *worker)
m_workers.erase(i); // workers auto-delete
}

unsigned int CJobManager::GetMaxWorkers(CJob::PRIORITY priority) const
unsigned int CJobManager::GetMaxWorkers(CJob::PRIORITY priority)
{
static const unsigned int max_workers = 5;
return max_workers - (CJob::PRIORITY_HIGH - priority);
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/JobManager.h
Expand Up @@ -314,7 +314,7 @@ class CJobManager

void StartWorkers(CJob::PRIORITY priority);
void RemoveWorker(const CJobWorker *worker);
unsigned int GetMaxWorkers(CJob::PRIORITY priority) const;
static unsigned int GetMaxWorkers(CJob::PRIORITY priority);

unsigned int m_jobCounter;

Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/LangCodeExpander.cpp
Expand Up @@ -446,7 +446,7 @@ bool CLangCodeExpander::CompareFullLangNames(const CStdString& lang1, const CStd
return expandedLang1.Equals(expandedLang2);
}

std::vector<std::string> CLangCodeExpander::GetLanguageNames(LANGFORMATS format /* = CLangCodeExpander::ISO_639_1 */) const
std::vector<std::string> CLangCodeExpander::GetLanguageNames(LANGFORMATS format /* = CLangCodeExpander::ISO_639_1 */)
{
std::vector<std::string> languages;
const LCENTRY *lang = g_iso639_1;
Expand Down
14 changes: 7 additions & 7 deletions xbmc/utils/LangCodeExpander.h
Expand Up @@ -74,31 +74,31 @@ class CLangCodeExpander
* \return The 3-Char ISO 639-2/T code of lang if that code exists, lang otherwise.
*/
CStdString ConvertToISO6392T(const CStdString& lang);
bool ConvertTwoToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strTwoCharCode, bool checkWin32Locales = false);
bool ConvertToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strCharCode, bool checkXbmcLocales = true, bool checkWin32Locales = false);
static bool ConvertTwoToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strTwoCharCode, bool checkWin32Locales = false);
static bool ConvertToThreeCharCode(CStdString& strThreeCharCode, const CStdString& strCharCode, bool checkXbmcLocales = true, bool checkWin32Locales = false);

#ifdef TARGET_WINDOWS
bool ConvertLinuxToWindowsRegionCodes(const CStdString& strTwoCharCode, CStdString& strThreeCharCode);
bool ConvertWindowsToGeneralCharCode(const CStdString& strWindowsCharCode, CStdString& strThreeCharCode);
static bool ConvertLinuxToWindowsRegionCodes(const CStdString& strTwoCharCode, CStdString& strThreeCharCode);
static bool ConvertWindowsToGeneralCharCode(const CStdString& strWindowsCharCode, CStdString& strThreeCharCode);
#endif

void LoadUserCodes(const TiXmlElement* pRootElement);
void Clear();

std::vector<std::string> GetLanguageNames(LANGFORMATS format = ISO_639_1) const;
static std::vector<std::string> GetLanguageNames(LANGFORMATS format = ISO_639_1);
protected:

/** \brief Converts a language code given as a long, see #MAKECODE(a, b, c, d)
* to its string representation.
* \param[in] code The language code given as a long, see #MAKECODE(a, b, c, d).
* \param[out] ret The string representation of the given language code code.
*/
void CodeToString(long code, CStdString& ret);
static void CodeToString(long code, CStdString& ret);

typedef std::map<CStdString, CStdString> STRINGLOOKUPTABLE;
STRINGLOOKUPTABLE m_mapUser;

bool LookupInDb(CStdString& desc, const CStdString& code);
static bool LookupInDb(CStdString& desc, const CStdString& code);
bool LookupInMap(CStdString& desc, const CStdString& code);

/** \brief Looks up the ISO 639-1, ISO 639-2/T, or ISO 639-2/B, whichever it finds first,
Expand Down
6 changes: 3 additions & 3 deletions xbmc/utils/RecentlyAddedJob.h
Expand Up @@ -32,9 +32,9 @@ class CRecentlyAddedJob : public CJob
{
public:
CRecentlyAddedJob(int flag);
bool UpdateVideo();
bool UpdateMusic();
bool UpdateTotal();
static bool UpdateVideo();
static bool UpdateMusic();
static bool UpdateTotal();
virtual bool DoWork();
private:
int m_flag;
Expand Down
14 changes: 7 additions & 7 deletions xbmc/utils/SystemInfo.h
Expand Up @@ -66,13 +66,13 @@ class CSysInfoJob : public CJob

static CSysData::INTERNET_STATE GetInternetState();
private:
bool SystemUpTime(int iInputMinutes, int &iMinutes, int &iHours, int &iDays);
double GetCPUFrequency();
CStdString GetSystemUpTime(bool bTotalUptime);
CStdString GetCPUFreqInfo();
CStdString GetMACAddress();
CStdString GetVideoEncoder();
CStdString GetBatteryLevel();
static bool SystemUpTime(int iInputMinutes, int &iMinutes, int &iHours, int &iDays);
static double GetCPUFrequency();
static CStdString GetSystemUpTime(bool bTotalUptime);
static CStdString GetCPUFreqInfo();
static CStdString GetMACAddress();
static CStdString GetVideoEncoder();
static CStdString GetBatteryLevel();

CSysData m_info;
};
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/TextSearch.h
Expand Up @@ -39,7 +39,7 @@ class CTextSearch
bool IsValid(void) const;

private:
void GetAndCutNextTerm(CStdString &strSearchTerm, CStdString &strNextTerm);
static void GetAndCutNextTerm(CStdString &strSearchTerm, CStdString &strNextTerm);
void ExtractSearchTerms(const CStdString &strSearchTerm, TextSearchDefault defaultSearchMode);

bool m_bCaseSensitive;
Expand Down
10 changes: 5 additions & 5 deletions xbmc/utils/TimeSmoother.h
Expand Up @@ -123,7 +123,7 @@ class CTimeSmoother
\param threshold the threshold to determine whether a data point is close to a given bin as a proportion of bin mean
\param minbinsize the minimum bin size of each bin
*/
void BinData(const boost::circular_buffer<double> &data, std::vector<double> &bins, const double threshold, const unsigned int minbinsize);
static void BinData(const boost::circular_buffer<double> &data, std::vector<double> &bins, const double threshold, const unsigned int minbinsize);

/*! \brief Given a real value, find a rational convergent
Uses a continued fraction expansion of value to determine the numerator and denominator of a rational convergent
Expand All @@ -133,7 +133,7 @@ class CTimeSmoother
\param denom [out] the denominator
\param maxnumden the maximal value of min(num, denom)
*/
void GetConvergent(double value, unsigned int &num, unsigned int &denom, const unsigned int maxnumden);
static void GetConvergent(double value, unsigned int &num, unsigned int &denom, const unsigned int maxnumden);

/*! \brief Given a set of data, find integer multipliers such that data[i] \sim quotient[i] * gcd(data)
Uses rational convergents to data[i]/min(data) to find integer multipliers to the (approximate) greatest common divisor
Expand All @@ -143,7 +143,7 @@ class CTimeSmoother
\param maxminmult the maximal value of multiplier[min(data)]
\sa GetConvergent
*/
void GetGCDMultipliers(const std::vector<double> &data, std::vector<unsigned int> &multipliers, const unsigned int maxminmult);
static void GetGCDMultipliers(const std::vector<double> &data, std::vector<unsigned int> &multipliers, const unsigned int maxminmult);

/*! \brief Given a set of bins and integer values associated with each bin, find the integer representation of some data
This allows noisy data to be approximated by a set of clean data, and to compute the integer representation of that data.
Expand All @@ -152,7 +152,7 @@ class CTimeSmoother
\param bins the bins to use for approximating the data
\param intBins the integer representation of the bins
*/
void GetIntRepresentation(const boost::circular_buffer<double> &data, std::vector<unsigned int> &intData, const std::vector<double> &bins, const std::vector<unsigned int> &intBins);
static void GetIntRepresentation(const boost::circular_buffer<double> &data, std::vector<unsigned int> &intData, const std::vector<double> &bins, const std::vector<unsigned int> &intBins);

/*! \brief Given a set of data, and an integer representation of that data, estimate the period of the data
Essentially we solve a linear regression d_i = \theta*z_i, where d_i is the original data, and z_i is the integer
Expand All @@ -163,7 +163,7 @@ class CTimeSmoother
\param intData an integral representation of the data
\return the period of the data
*/
double EstimatePeriod(const boost::circular_buffer<double> &data, const std::vector<unsigned int> &intData);
static double EstimatePeriod(const boost::circular_buffer<double> &data, const std::vector<unsigned int> &intData);

/*! \brief Compute the next frame time
\param currentTime the current time
Expand Down
18 changes: 9 additions & 9 deletions xbmc/utils/TuxBoxUtil.h
Expand Up @@ -149,10 +149,10 @@ class CTuxBoxUtil
virtual ~CTuxBoxUtil(void);

bool GetZapUrl(const CStdString& strPath, CFileItem &items);
bool ParseBouquets(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
bool ParseBouquetsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
bool ParseChannels(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
bool ParseChannelsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
static bool ParseBouquets(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
static bool ParseBouquetsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
static bool ParseChannels(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString strFilter, CStdString strChild);
static bool ParseChannelsEnigma2(TiXmlElement *root, CFileItemList &items, CURL &url, CStdString& strFilter, CStdString& strChild);
bool ZapToUrl(CURL url, const CStdString &pathOption);
bool StreamInformations(TiXmlElement *pRootElement);
bool CurrentServiceData(TiXmlElement *pRootElement);
Expand All @@ -165,12 +165,12 @@ class CTuxBoxUtil
bool GetVideoSubChannels(CStdString& strVideoSubChannelName, CStdString& strVideoSubChannelPid);
bool GetVideoChannels(TiXmlElement *pRootElement);
bool CreateNewItem(const CFileItem& item, CFileItem& item_new);
bool InitZapstream(const CStdString& strPath);
bool SetAudioChannel(const CStdString& strPath, const AUDIOCHANNEL& sAC);
static bool InitZapstream(const CStdString& strPath);
static bool SetAudioChannel(const CStdString& strPath, const AUDIOCHANNEL& sAC);

CStdString GetPicon(CStdString strServiceName);
CStdString GetSubMode(int iMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
CStdString DetectSubMode(CStdString strSubMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
static CStdString GetPicon(CStdString strServiceName);
static CStdString GetSubMode(int iMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
static CStdString DetectSubMode(CStdString strSubMode, CStdString& strXMLRootString, CStdString& strXMLChildString);
};
extern CTuxBoxUtil g_tuxbox;

Expand Down
4 changes: 2 additions & 2 deletions xbmc/utils/Weather.h
Expand Up @@ -103,15 +103,15 @@ class CWeatherJob : public CJob
void LocalizeOverview(CStdString &str);
void LocalizeOverviewToken(CStdString &str);
void LoadLocalizedToken();
int ConvertSpeed(int speed);
static int ConvertSpeed(int speed);

void SetFromProperties();

/*! \brief Formats a celcius temperature into a string based on the users locale
\param text the string to format
\param temp the temperature (in degrees celcius).
*/
void FormatTemperature(CStdString &text, int temp);
static void FormatTemperature(CStdString &text, int temp);

struct ci_less : std::binary_function<std::string, std::string, bool>
{
Expand Down
2 changes: 1 addition & 1 deletion xbmc/utils/WindowsShortcut.h
Expand Up @@ -37,7 +37,7 @@ class CWindowsShortcut
CWindowsShortcut();
virtual ~CWindowsShortcut();
static bool IsShortcut(const string& strFileName);
bool GetShortcut(const string& strFileName, string& strFileOrDir);
static bool GetShortcut(const string& strFileName, string& strFileOrDir);
};

#endif // !defined(AFX_WINDOWSSHORTCUT_H__A905CF83_3C3D_44FF_B3EF_778D70676D2C__INCLUDED_)

0 comments on commit e92e64c

Please sign in to comment.