Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #206 from cptspiff/remove-convutils

Remove convutils
  • Loading branch information...
commit 1d39bd9a5d64b26a96e642ee3ac388155bdf88c1 2 parents 2ce8801 + 83260d3
Arne Morten Kvarving authored
View
6 xbmc/GUIPassword.cpp
@@ -93,7 +93,8 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType)
pItem->m_iBadPwdCount = 0;
pItem->m_iHasLock = 1;
g_passwordManager.LockSource(strType,strLabel,false);
- g_settings.UpdateSource(strType, strLabel, "badpwdcount", itoa(pItem->m_iBadPwdCount, buffer, 10));
+ sprintf(buffer,"%i",pItem->m_iBadPwdCount);
+ g_settings.UpdateSource(strType, strLabel, "badpwdcount", buffer);
g_settings.SaveSources();
break;
}
@@ -102,7 +103,8 @@ bool CGUIPassword::IsItemUnlocked(CFileItem* pItem, const CStdString &strType)
// password entry failed
if (0 != g_guiSettings.GetInt("masterlock.maxretries"))
pItem->m_iBadPwdCount++;
- g_settings.UpdateSource(strType, strLabel, "badpwdcount", itoa(pItem->m_iBadPwdCount, buffer, 10));
+ sprintf(buffer,"%i",pItem->m_iBadPwdCount);
+ g_settings.UpdateSource(strType, strLabel, "badpwdcount", buffer);
g_settings.SaveSources();
break;
}
View
8 xbmc/cores/DllLoader/exports/emu_kernel32.cpp
@@ -891,7 +891,11 @@ extern "C" int WINAPI dllMultiByteToWideChar(UINT CodePage, DWORD dwFlags, LPCST
destinationBuffer = (LPWSTR)malloc(destinationBufferSize * sizeof(WCHAR));
}
+#ifdef _WIN32
int ret = MultiByteToWideChar(CodePage, dwFlags, lpMultiByteStr, cbMultiByte, destinationBuffer, destinationBufferSize);
+#else
+ int ret = 0;
+#endif
if (ret > 0)
{
@@ -929,7 +933,11 @@ extern "C" int WINAPI dllWideCharToMultiByte(UINT CodePage, DWORD dwFlags, LPCWS
destinationBuffer = (LPSTR)malloc(destinationBufferSize * sizeof(char));
}
+#ifdef _WIN32
int ret = WideCharToMultiByte(CodePage, dwFlags, lpWideCharStr, cchWideChar, destinationBuffer, destinationBufferSize, lpDefaultChar, lpUsedDefaultChar);
+#else
+ int ret = 0;
+#endif
if (ret > 0)
{
View
7 xbmc/cores/DllLoader/exports/emu_msvcrt.cpp
@@ -1936,7 +1936,12 @@ extern "C"
memcpy(var, envstring, value_start - envstring);
var[value_start - envstring] = 0;
- strupr(var);
+ char* temp = var;
+ while (*temp)
+ {
+ *temp = (char)toupper(*temp);
+ temp++;
+ }
strncpy(value, value_start + 1, size);
if (size)
View
3  xbmc/filesystem/FileRTV.cpp
@@ -80,8 +80,9 @@ bool CFileRTV::Open(const char* strHostName, const char* strFileName, int iport)
if (iport)
{
char buffer[10];
+ sprintf(buffer,"%i",iport);
strHostAndPort += ':';
- strHostAndPort += itoa(iport, buffer, 10);
+ strHostAndPort += buffer;
}
// Get the file size of strFileName. If size is 0 or negative, file doesn't exist so exit.
View
3  xbmc/filesystem/RTVDirectory.cpp
@@ -122,8 +122,9 @@ bool CRTVDirectory::GetDirectory(const CStdString& strPath, CFileItemList &items
if (url.HasPort())
{
char buffer[10];
+ sprintf(buffer,"%i",url.GetPort());
strHostAndPort += ':';
- strHostAndPort += itoa(url.GetPort(), buffer, 10);
+ strHostAndPort += buffer;
}
// No path given, list shows from ReplayGuide
View
7 xbmc/interfaces/http-api/XBMCConfiguration.cpp
@@ -67,13 +67,14 @@ int CXbmcConfiguration::BookmarkSize( int eid, webs_t wp, CStdString& response,
if (pShares)
{
char buffer[10];
+ sprintf(buffer,"%i",pShares->size());
- if (eid!=-1)
- ejSetResult( eid, itoa(pShares->size(), buffer, 10));
+ if (eid!=-1)
+ ejSetResult( eid, buffer);
else
{
CStdString tmp;
- tmp.Format("%s", itoa(pShares->size(), buffer, 10));
+ tmp.Format("%i", pShares->size());
response="" + tmp;
}
View
78 xbmc/linux/ConvUtils.cpp
@@ -27,59 +27,10 @@
#include <ctype.h>
#include <errno.h>
-
-/*
- ** The following two functions together make up an itoa()
- ** implementation. Function i2a() is a 'private' function
- ** called by the public itoa() function.
- **
- ** itoa() takes three arguments:
- ** 1) the integer to be converted,
- ** 2) a pointer to a character conversion buffer,
- ** 3) the radix for the conversion
- ** which can range between 2 and 36 inclusive
- ** range errors on the radix default it to base10
- */
-
-static char *i2a(unsigned i, char *a, unsigned r)
-{
- if (i/r > 0) a = i2a(i/r,a,r);
- *a = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"[i%r];
- return a+1;
-}
-
-char *itoa(int i, char *a, int r)
-{
- if ((r < 2) || (r > 36)) r = 10;
- if (i<0) {
- *a = '-';
- *i2a(-(unsigned)i,a+1,r) = 0;
- } else *i2a(i,a,r) = 0;
- return a;
-}
-
void OutputDebugString(LPCTSTR lpOuputString)
{
}
-void strlwr( char* string )
-{
- while ( *string )
- {
- *string = (char)tolower( *string );
- string++;
- }
-}
-
-void strupr( char* string )
-{
- while ( *string )
- {
- *string = (char)toupper( *string );
- string++;
- }
-}
-
LONGLONG Int32x32To64(LONG Multiplier, LONG Multiplicand)
{
LONGLONG result = Multiplier;
@@ -87,35 +38,6 @@ LONGLONG Int32x32To64(LONG Multiplier, LONG Multiplicand)
return result;
}
-int WideCharToMultiByte(
- UINT CodePage,
- DWORD dwFlags,
- LPCWSTR lpWideCharStr,
- int cchWideChar,
- LPSTR lpMultiByteStr,
- int cbMultiByte,
- LPCSTR lpDefaultChar,
- LPBOOL lpUsedDefaultChar
-) {
-
- // TODO: need to implement WideCharToMultiByte
- return 0;
-}
-
-int MultiByteToWideChar(
- UINT CodePage,
- DWORD dwFlags,
- LPCSTR lpMultiByteStr,
- int cbMultiByte,
- LPWSTR lpWideCharStr,
- int cchWideChar
-) {
-
- // TODO: need to implement MultiByteToWideChar
- return 0;
-
-}
-
DWORD GetLastError()
{
return errno;
View
21 xbmc/linux/ConvUtils.h
@@ -23,27 +23,6 @@
*/
#include "PlatformDefs.h" // UINT DWORD LPCSTR LPSTR LPBOOL ...
-int WideCharToMultiByte(
- UINT CodePage,
- DWORD dwFlags,
- LPCWSTR lpWideCharStr,
- int cchWideChar,
- LPSTR lpMultiByteStr,
- int cbMultiByte,
- LPCSTR lpDefaultChar,
- LPBOOL lpUsedDefaultChar
-);
-
-int MultiByteToWideChar(
- UINT CodePage,
- DWORD dwFlags,
- LPCSTR lpMultiByteStr,
- int cbMultiByte,
- LPWSTR lpWideCharStr,
- int cchWideChar
-);
-
-
DWORD GetLastError();
VOID SetLastError(DWORD dwErrCode);
View
6 xbmc/linux/PlatformDefs.h
@@ -588,12 +588,6 @@ typedef struct _D3DMATRIX {
#define FILE_SHARE_WRITE 0x00000002
#define FILE_SHARE_DELETE 0x00000004
-
-// String
-char *itoa(int i, char *a, int r);
-void strlwr(char* string);
-void strupr(char* string);
-
// Audio stuff
typedef struct tWAVEFORMATEX
{
Please sign in to comment.
Something went wrong with that request. Please try again.