This Trac instance is not used for development anymore!

We migrated our development workflow to git and Gitea.
To test the future redirection, replace trac by ariadne in the page URL.

Changeset 10059 for ps


Ignore:
Timestamp:
08/22/11 10:54:56 (13 years ago)
Author:
Jan Wassenberg
Message:

minor fixes: add missing arena.cpp; add required NONCOPYABLE annotation; fix UNUSED2 to work in the case of references.

Location:
ps/trunk/source/lib
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • ps/trunk/source/lib/allocators/arena.h

    r10051 r10059  
    4343class Arena
    4444{
     45    NONCOPYABLE(Arena);
    4546public:
    4647    Arena(size_t maxSize)
  • ps/trunk/source/lib/allocators/pool.h

    r10052 r10059  
    4444class Pool
    4545{
     46    NONCOPYABLE(Pool);
    4647public:
    4748    // (must round up because freelist stores pointers inside objects)
  • ps/trunk/source/lib/code_annotation.h

    r9423 r10059  
    3232
    3333/**
    34  * mark a function local variable or parameter as unused and avoid
    35  * the corresponding compiler warning.
    36  * use inside the function body, e.g. void f(int x) { UNUSED2(x); }
    37  **/
    38 #if ICC_VERSION
    39 // NB: #pragma unused is documented but "unrecognized" when used;
    40 // casting to void isn't sufficient, but the following is:
    41 # define UNUSED2(param) param = param
    42 #else
    43 # define UNUSED2(param) (void)param
    44 #endif
    45 
    46 /**
    4734 * mark a function parameter as unused and avoid
    4835 * the corresponding compiler warning.
     
    5037 **/
    5138#define UNUSED(param)
     39
     40/**
     41 * mark a function local variable or parameter as unused and avoid
     42 * the corresponding compiler warning.
     43 * note that UNUSED is not applicable to variable definitions that
     44 * involve initialization, nor is it sufficient in cases where
     45 * an argument is unused only in certain situations.
     46 * example: void f(int x) { ASSERT(x == 0); UNUSED2(x); }
     47 * this asserts in debug builds and avoids warnings in release.
     48 **/
     49#if HAVE_C99 && GCC_VERSION // _Pragma from C99, unused from GCC
     50# define UNUSED2(param) _Pragma("unused " #param)
     51#elif ICC_VERSION
     52// ICC 12 still doesn't recognize pragma unused, casting to void
     53// isn't sufficient, and self-assignment doesn't work for references.
     54# define UNUSED2(param) do{ if(&param) {} } while(false)
     55#else
     56# define UNUSED2(param) ((void)(param))
     57#endif
    5258
    5359
  • ps/trunk/source/lib/sysdep/os/win/wsdl.cpp

    r9423 r10059  
    14971497    // that means stdout isn't associated with a lowio handle; _close is
    14981498    // called with fd = -1. oh well, there's nothing we can do.
    1499     FILE* f = 0;
    1500     errno_t ret = _wfreopen_s(&f, OsString(pathname).c_str(), L"wt", stdout);
    1501     // (ignore return value - it might indicate 'file already exists' even
    1502     // if f is valid, which is what actually counts)
    1503     UNUSED2(ret);
     1499    FILE* f = 0;
     1500    // ignore return value - it might indicate 'file already exists' even
     1501    // if f is valid, which is what actually counts.
     1502    (void)_wfreopen_s(&f, OsString(pathname).c_str(), L"wt", stdout);
    15041503    if(GetLastError() == ERROR_ALREADY_EXISTS)
    15051504        SetLastError(0);
Note: See TracChangeset for help on using the changeset viewer.