VirtualBox

Changeset 53972 in vbox


Ignore:
Timestamp:
Jan 27, 2015 10:50:42 AM (10 years ago)
Author:
vboxsync
Message:

Additions/x11: remove unnecessary IPRT support code from X.Org drivers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuestLib/VBoxGuestR3LibRuntimeXF86.cpp

    r52210 r53972  
    3434#include <iprt/log.h>
    3535#include <iprt/mem.h>
    36 #include <iprt/string.h>
    3736#if defined(VBOX_VBGLR3_XFREE86)
    3837extern "C" {
    3938# define XFree86LOADER
    4039# include <xf86_ansic.h>
    41 # include <errno.h>
    4240# undef size_t
    4341}
    4442#else
    45 # include <ctype.h>
    46 # include <errno.h>
    4743# include <stdarg.h>
    48 # include <stdio.h>
    4944# include <stdlib.h>
    5045# define xalloc malloc
    51 # define xf86vsnprintf vsnprintf
    52 # define xf86errno errno
    53 # define xf86strtoul strtoul
    54 # define xf86isspace isspace
    5546# define xfree free
    5647extern "C" void ErrorF(const char *f, ...);
    57 extern "C" void VErrorF(const char *f, va_list args);
    5848#endif
    59 
    60 /* This is risky as it restricts call to the ANSI format type specifiers. */
    61 RTDECL(size_t) RTStrPrintf(char *pszBuffer, size_t cchBuffer, const char *pszFormat, ...)
    62 {
    63     va_list args;
    64     int cbRet;
    65     va_start(args, pszFormat);
    66     cbRet = xf86vsnprintf(pszBuffer, cchBuffer, pszFormat, args);
    67     va_end(args);
    68     return cbRet >= 0 ? cbRet : 0;
    69 }
    70 
    71 RTDECL(int) RTStrToUInt32Ex(const char *pszValue, char **ppszNext, unsigned uBase, uint32_t *pu32)
    72 {
    73     char *pszNext = NULL;
    74     xf86errno = 0;
    75     unsigned long ul = xf86strtoul(pszValue, &pszNext, uBase);
    76     if (ppszNext)
    77         *ppszNext = pszNext;
    78     if (RT_UNLIKELY(pszValue == pszNext))
    79         return VERR_NO_DIGITS;
    80     if (RT_UNLIKELY(ul > UINT32_MAX))
    81         ul = UINT32_MAX;
    82     if (pu32)
    83         *pu32 = (uint32_t) ul;
    84     if (RT_UNLIKELY(xf86errno == EINVAL))
    85         return VERR_INVALID_PARAMETER;
    86     if (RT_UNLIKELY(xf86errno == ERANGE))
    87         return VWRN_NUMBER_TOO_BIG;
    88     if (RT_UNLIKELY(xf86errno))
    89         /* RTErrConvertFromErrno() is not available */
    90         return VERR_UNRESOLVED_ERROR;
    91     if (RT_UNLIKELY(*pszValue == '-'))
    92         return VWRN_NEGATIVE_UNSIGNED;
    93     if (RT_UNLIKELY(*pszNext))
    94     {
    95         while (*pszNext)
    96             if (!xf86isspace(*pszNext))
    97                 return VWRN_TRAILING_CHARS;
    98         return VWRN_TRAILING_SPACES;
    99     }
    100     return VINF_SUCCESS;
    101 }
    102 
    103 RTDECL(int) RTStrToUInt32Full(const char *pszValue, unsigned uBase, uint32_t *pu32)
    104 {
    105     char *psz;
    106     int rc = RTStrToUInt32Ex(pszValue, &psz, uBase, pu32);
    107     if (RT_SUCCESS(rc) && *psz)
    108         if (rc == VWRN_TRAILING_CHARS || rc == VWRN_TRAILING_SPACES)
    109             rc = -rc;
    110     return rc;
    111 }
    11249
    11350RTDECL(void)    RTAssertMsg1Weak(const char *pszExpr, unsigned uLine, const char *pszFile, const char *pszFunction)
     
    12057RTDECL(void)    RTAssertMsg2Weak(const char *pszFormat, ...)
    12158{
    122     va_list args;
    123     va_start(args, pszFormat);
    124     VErrorF(pszFormat, args);
    125     va_end(args);
     59    NOREF(pszFormat);
    12660}
    12761
     
    13872RTDECL(void) RTLogLoggerEx(PRTLOGGER, unsigned, unsigned, const char *pszFormat, ...)
    13973{
    140     va_list args;
    141     va_start(args, pszFormat);
    142     VErrorF(pszFormat, args);
    143     va_end(args);
     74    NOREF(pszFormat);
    14475}
    14576
     
    15485    xfree(pv);
    15586}
    156 
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