summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorJulien Nabet <serval2412@yahoo.fr>2017-03-18 13:00:52 +0100
committerNoel Grandin <noel.grandin@collabora.co.uk>2017-03-18 19:12:14 +0000
commit4c2b298afc84be7558b3d7025c5c80e82c49b0ef (patch)
treef5e0f0b16f759a1c8e9dbff1fd673586193fd86b /vcl
parent68722bd4ba0442f95122ebf5505bc1ea548ce526 (diff)
Use char instead of unsigned char
to avoid some reinterpret_cast + prepare to replace some alloca calls + replace C cast by using plain char assignment Change-Id: Iff65b9a324ca1cc936c9effd2b3b71596d6e9b0f Reviewed-on: https://gerrit.libreoffice.org/35398 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/unx/saldisp.hxx2
-rw-r--r--vcl/unx/generic/app/saldisp.cxx8
-rw-r--r--vcl/unx/generic/window/salframe.cxx4
3 files changed, 7 insertions, 7 deletions
diff --git a/vcl/inc/unx/saldisp.hxx b/vcl/inc/unx/saldisp.hxx
index de4e93cf3950..44e851a8b981 100644
--- a/vcl/inc/unx/saldisp.hxx
+++ b/vcl/inc/unx/saldisp.hxx
@@ -327,7 +327,7 @@ public:
OUString GetKeyName( sal_uInt16 nKeyCode ) const;
sal_uInt16 GetKeyCode( KeySym keysym, char*pcPrintable ) const;
KeySym GetKeySym( XKeyEvent *pEvent,
- unsigned char *pPrintable,
+ char *pPrintable,
int *pLen,
KeySym *pUnmodifiedKeySym,
Status *pStatus,
diff --git a/vcl/unx/generic/app/saldisp.cxx b/vcl/unx/generic/app/saldisp.cxx
index c694096b549b..cc119eccd0f4 100644
--- a/vcl/unx/generic/app/saldisp.cxx
+++ b/vcl/unx/generic/app/saldisp.cxx
@@ -1421,7 +1421,7 @@ sal_uInt16 SalDisplay::GetKeyCode( KeySym keysym, char*pcPrintable ) const
}
KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent,
- unsigned char *pPrintable,
+ char *pPrintable,
int *pLen,
KeySym *pUnmodifiedKeySym,
Status *pStatusReturn,
@@ -1442,17 +1442,17 @@ KeySym SalDisplay::GetKeySym( XKeyEvent *pEvent,
{
// XmbLookupString must not be called for KeyRelease events
// Cannot enter space in c locale problem #89616# #88978# btraq #4478197
- *pLen = XLookupString( pEvent, reinterpret_cast<char*>(pPrintable), 1, &nKeySym, nullptr );
+ *pLen = XLookupString( pEvent, pPrintable, 1, &nKeySym, nullptr );
}
else
{
*pLen = XmbLookupString( aInputContext,
- pEvent, reinterpret_cast<char*>(pPrintable), *pLen - 1, &nKeySym, pStatusReturn );
+ pEvent, pPrintable, *pLen - 1, &nKeySym, pStatusReturn );
// Lookup the string again, now with appropriate size
if ( *pStatusReturn == XBufferOverflow )
{
- pPrintable[ 0 ] = (char)0;
+ pPrintable[ 0 ] = '\0';
return 0;
}
diff --git a/vcl/unx/generic/window/salframe.cxx b/vcl/unx/generic/window/salframe.cxx
index ea6271946b1f..869ce6a1b729 100644
--- a/vcl/unx/generic/window/salframe.cxx
+++ b/vcl/unx/generic/window/salframe.cxx
@@ -2993,7 +2993,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
KeySym nKeySym;
KeySym nUnmodifiedKeySym;
int nLen = 2048;
- unsigned char *pPrintable = static_cast<unsigned char*>(alloca( nLen ));
+ char *pPrintable = static_cast<char*>(alloca( nLen ));
// singlebyte code composed by input method, the new default
if (mpInputContext != nullptr && mpInputContext->UseContext())
@@ -3007,7 +3007,7 @@ long X11SalFrame::HandleKeyEvent( XKeyEvent *pEvent )
if ( nStatus == XBufferOverflow )
{
nLen *= 2;
- pPrintable = static_cast<unsigned char*>(alloca( nLen ));
+ pPrintable = static_cast<char*>(alloca( nLen ));
nKeySym = pDisplay_->GetKeySym( pEvent, pPrintable, &nLen,
&nUnmodifiedKeySym,
&nStatus, mpInputContext->GetContext() );