VirtualBox

Changeset 88297 in vbox


Ignore:
Timestamp:
Mar 26, 2021 12:29:59 PM (4 years ago)
Author:
vboxsync
Message:

Some small Solaris-specific build warning fixes:

include/iprt/x86.h: Undefine MSR_IA32_FLUSH_CMD to avoid warning about
'"MSR_IA32_FLUSH_CMD" redefined' when compiling SUPLibLdr.cpp.
SUPLibLdr.cpp includes <stdlib.h> which ultimately pulls in
<sys/controlregs.h> which has its own definition of MSR_IA32_FLUSH_CMD.

Additions/solaris/SharedFolders: Updated a handful of function prototypes
under SharedFolders/solaris10 which don't take any arguments to be
explicitly declared as 'function(void)' to silence gcc warnings from
-Wstrict-prototypes.

Main/src-server/solaris: Fixed two places where -Wconversion identified
possible alteration of the value due to different sized types.

RDP/client: Addressed an incorrect conversion descriptor type passed to
iconv(3C) in utils.c:utils_locale_to_utf8() (corresponding to unresolved
upstream issue #387 (https://github.com/rdesktop/rdesktop/issues/387).
Tidied up some inconsistent iconv(3C) argument type usage: the use of
-DUSE_LEGACY_PROTOTYPES requires -DICONV_CONST=const. Fixed some
incorrect strncpy()/strcat() calls using the corresponding code from
upstream.

Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/x86.h

    r86489 r88297  
    3939#endif
    4040
    41 /* Workaround for Solaris sys/regset.h defining CS, DS */
     41/** Workaround for Solaris sys/regset.h defining CS, DS and sys/controlregs.h
     42 * defining MSR_IA32_FLUSH_CMD */
    4243#ifdef RT_OS_SOLARIS
    4344# undef CS
    4445# undef DS
     46# undef MSR_IA32_FLUSH_CMD
    4547#endif
    4648
  • trunk/src/VBox/Main/src-server/solaris/NetIf-solaris.cpp

    r83794 r88297  
    6363     */
    6464    int cbInstance = 0;
    65     int cbIface = strlen(pszIfaceName);
     65    size_t cbIface = strlen(pszIfaceName);
    6666    const char *pszEnd = pszIfaceName + cbIface - 1;
    67     for (int i = 0; i < cbIface - 1; i++)
     67    for (size_t i = 0; i < cbIface - 1; i++)
    6868    {
    6969        if (!RT_C_IS_DIGIT(*pszEnd))
     
    333333     */
    334334    int cbInstance = 0;
    335     int cbIface = strlen(szIfaceName);
     335    size_t cbIface = strlen(szIfaceName);
    336336    const char *pszEnd = pszIface + cbIface - 1;
    337     for (int i = 0; i < cbIface - 1; i++)
     337    for (size_t i = 0; i < cbIface - 1; i++)
    338338    {
    339339        if (!RT_C_IS_DIGIT(*pszEnd))
  • trunk/src/VBox/Main/src-server/solaris/PerformanceSolaris.cpp

    r82968 r88297  
    336336     */
    337337    int cbInstance = 0;
    338     int cbIface = strlen(pszIfaceName);
     338    size_t cbIface = strlen(pszIfaceName);
    339339    const char *pszEnd = pszIfaceName + cbIface - 1;
    340     for (int i = 0; i < cbIface - 1; i++)
     340    for (size_t i = 0; i < cbIface - 1; i++)
    341341    {
    342342        if (!RT_C_IS_DIGIT(*pszEnd))
  • trunk/src/VBox/RDP/client-1.8.4/Makefile.kmk

    r82968 r88297  
    6161# define __USE_LEGACY_PROTOTYPES__ until our buildbox is updated sufficiently
    6262rdesktop-vrdp_DEFS.solaris = \
    63         HAVE_SYS_FILIO_H=1 RDPSND_SUN=1 HAVE_ICONV_H=1 ICONV_CONST= STAT_STATVFS64=1 _FILE_OFFSET_BITS=64 \
     63        HAVE_SYS_FILIO_H=1 RDPSND_SUN=1 ICONV_CONST=const STAT_STATVFS64=1 _FILE_OFFSET_BITS=64 \
    6464        DIR_FD_MEMBER_NAME=dd_fd __USE_LEGACY_PROTOTYPES__ HAVE_SYS_VFS_H=1 HAVE_SYS_STATFS_H=1
    6565rdesktop-vrdp_DEFS.freebsd = \
  • trunk/src/VBox/RDP/client-1.8.4/rdesktop.c

    r76779 r88297  
    658658                        case 'u':
    659659                                g_username = (char *) xmalloc(strlen(optarg) + 1);
    660                                 STRNCPY(g_username, optarg, strlen(optarg) + 1);
     660                                strcpy(g_username, optarg);
    661661                                username_option = 1;
    662662                                break;
     
    12091209                        xfree(g_username);
    12101210                        g_username = (char *) xmalloc(strlen(g_redirect_username) + 1);
    1211                         STRNCPY(g_username, g_redirect_username, strlen(g_redirect_username) + 1);
     1211                        strcpy(g_username, g_redirect_username);
    12121212                        STRNCPY(server, g_redirect_server, sizeof(server));
    12131213                        flags |= RDP_INFO_AUTOLOGON;
     
    16401640        if (*rest)
    16411641                STRNCPY(buf, *rest, buflen);
    1642         strncat(buf, input, inputlen);
     1642        strncat(buf, input, buflen);
    16431643        p = buf;
    16441644
  • trunk/src/VBox/RDP/client-1.8.4/rdp.c

    r76779 r88297  
    3939#ifdef HAVE_ICONV
    4040#ifdef HAVE_ICONV_H
    41 
    42 #if defined(RT_OS_SOLARIS) && !defined(_XPG6)
    43 # define VBOX_XPG6_TMP_DEF
    44 # define _XPG6
    45 #endif
    46 #if defined(RT_OS_SOLARIS) && defined(__USE_LEGACY_PROTOTYPES__)
    47 # define VBOX_LEGACY_PROTO_TMP_DEF
    48 # undef __USE_LEGACY_PROTOTYPES__
    49 #endif
    5041#include <iconv.h>
    51 #if defined(VBOX_XPG6_TMP_DEF)
    52 # undef _XPG6
    53 # undef VBOX_XPG6_TMP_DEF
    54 #endif
    55 #if defined(VBOX_LEGACY_PROTO_TMP_DEF)
    56 # define  __USE_LEGACY_PROTOTYPES__
    57 # undef VBOX_LEGACY_PROTO_TMP_DEF
    5842#endif
    5943
    6044#ifndef ICONV_CONST
    6145#define ICONV_CONST ""
    62 #endif
    6346#endif
    6447#endif
     
    729712        out_uint16(s, 0);       /* Compression types */
    730713        out_uint16_le(s, (g_rdp_version >= RDP_V5) ? 0x40d : 0);
    731         /* Pad, according to T.128. 0x40d seems to 
     714        /* Pad, according to T.128. 0x40d seems to
    732715           trigger
    733            the server to start sending RDP5 packets. 
     716           the server to start sending RDP5 packets.
    734717           However, the value is 0x1d04 with W2KTSK and
    735718           NT4MS. Hmm.. Anyway, thankyou, Microsoft,
    736            for sending such information in a padding 
     719           for sending such information in a padding
    737720           field.. */
    738721        out_uint16(s, 0);       /* Update capability */
  • trunk/src/VBox/RDP/client-1.8.4/utils.c

    r55123 r88297  
    188188{
    189189#ifdef HAVE_ICONV
    190         static iconv_t *iconv_h = (iconv_t) - 1;
     190        static iconv_t iconv_h = (iconv_t) - 1;
    191191        if (strncmp(g_codepage, "UTF-8", strlen("UTF-8")) == 0)
    192192                goto pass_trough_as_is;
  • trunk/src/VBox/RDP/client-1.8.4/xclip.c

    r55123 r88297  
    4444#ifdef HAVE_ICONV
    4545#ifdef HAVE_LANGINFO_H
    46 #ifdef HAVE_ICONV_H
    4746#include <langinfo.h>
    48 
    49 #if defined(RT_OS_SOLARIS) && !defined(_XPG6)
    50 # define VBOX_XPG6_TMP_DEF
    51 # define _XPG6
    52 #endif
    53 #if defined(RT_OS_SOLARIS) && defined(__USE_LEGACY_PROTOTYPES__)
    54 # define VBOX_LEGACY_PROTO_TMP_DEF
    55 # undef __USE_LEGACY_PROTOTYPES__
    56 # endif
    57 #include <iconv.h>
    58 #if defined(VBOX_XPG6_TMP_DEF)
    59 # undef _XPG6
    60 # undef VBOX_XPG6_TMP_DEF
    61 #endif
    62 #if defined(VBOX_LEGACY_PROTO_TMP_DEF)
    63 # define  __USE_LEGACY_PROTOTYPES__
    64 # undef VBOX_LEGACY_PROTO_TMP_DEF
    65 #endif
    66 
    6747#define USE_UNICODE_CLIPBOARD
    6848#endif
     49#ifdef HAVE_ICONV_H
     50#include <iconv.h>
    6951#endif
    7052#endif
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette