当前位置: 首页>>代码示例>>C++>>正文


C++ STLSOFT_SUPPRESS_UNUSED函数代码示例

本文整理汇总了C++中STLSOFT_SUPPRESS_UNUSED函数的典型用法代码示例。如果您正苦于以下问题:C++ STLSOFT_SUPPRESS_UNUSED函数的具体用法?C++ STLSOFT_SUPPRESS_UNUSED怎么用?C++ STLSOFT_SUPPRESS_UNUSED使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了STLSOFT_SUPPRESS_UNUSED函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PANTHEIOS_CALL

PANTHEIOS_CALL(int) pantheios_be_logEntry(
    void*               feToken
,   void*               beToken
,   int                 severity
,   PAN_CHAR_T const*   entry
,   size_t              cchEntry
)
{
    STLSOFT_SUPPRESS_UNUSED(feToken);
    STLSOFT_SUPPRESS_UNUSED(beToken);
    STLSOFT_SUPPRESS_UNUSED(severity);
    STLSOFT_SUPPRESS_UNUSED(entry);

    if(0 == s_feInitValue)
    {
        XTESTS_FAIL_WITH_QUALIFIER("back-end entry logging", "front-end has not yet been initialised");
    }
    else if(1 != s_feInitValue)
    {
        XTESTS_FAIL_WITH_QUALIFIER("back-end entry logging", "front-end has been uninitialised");
    }
    else if(0 == s_beInitValue)
    {
        XTESTS_FAIL_WITH_QUALIFIER("back-end entry logging", "back-end has not been initialised");
    }
    else if(1 != s_beInitValue)
    {
        XTESTS_FAIL_WITH_QUALIFIER("back-end entry logging", "back-end has been uninitialised");
    }

        return (int)cchEntry;
}
开发者ID:synesissoftware,项目名称:Pantheios,代码行数:32,代码来源:test.component.core.initialisation_sequence.c

示例2: main_

static int main_(int argc, char **argv)
{
#ifndef PANTHEIOS_USE_WIDE_STRINGS
    pantheios::log_DEBUG("main_(", pantheios::args(argc, argv), ")");
#endif

    {
        unsigned    flags = PANTHEIOS_BE_FILE_F_DISCARD_CACHED_CONTENTS | PANTHEIOS_BE_FILE_F_TRUNCATE;

        int res1 = pantheios_be_file_setFilePath(PSTR("test-%T-%D.log"), flags, flags, PANTHEIOS_BEID_LOCAL);

        pantheios_be_file_flush(PANTHEIOS_BEID_LOCAL);

        pantheios::log_NOTICE(PSTR("stmt 1"));
    }

#ifndef PANTHEIOS_USE_WIDE_STRINGS
    {
        pantheios::log_NOTICE("stmt 1");
        unsigned    flags = PANTHEIOS_BE_FILE_F_DISCARD_CACHED_CONTENTS | PANTHEIOS_BE_FILE_F_TRUNCATE;

        int res1 = pantheios_be_file_setFilePath(FILENAME_LOCAL, flags, flags, PANTHEIOS_BEID_LOCAL);

        pantheios::log_NOTICE("stmt 2");
        pantheios::log_NOTICE("stmt 3");

        int res2 = pantheios_be_file_setFilePath(FILENAME_REMOTE, flags, flags, PANTHEIOS_BEID_REMOTE);

        pantheios::log_NOTICE("stmt 4");
        pantheios::log_NOTICE("stmt 5");

        pantheios_be_file_setFilePath(NULL, PANTHEIOS_BEID_LOCAL);
        pantheios_be_file_setFilePath(NULL, PANTHEIOS_BEID_REMOTE);

        pantheios::log_NOTICE("stmt 6");
        pantheios::log_NOTICE("stmt 7");

        file_lines_t    local_lines(FILENAME_LOCAL);
        file_lines_t    remote_lines(FILENAME_REMOTE);

        const size_t    numLocal    =   local_lines.size();
        const size_t    numRemote   =   remote_lines.size();

        STLSOFT_ASSERT(4 == numLocal);
        STLSOFT_ASSERT(2 == numRemote);

        fs_traits_t::delete_file(FILENAME_LOCAL);
        fs_traits_t::get_last_error();
        fs_traits_t::delete_file(FILENAME_REMOTE);
        fs_traits_t::get_last_error();

        STLSOFT_SUPPRESS_UNUSED(res1);
        STLSOFT_SUPPRESS_UNUSED(res2);
    }
#endif

    pantheios::log_DEBUG(PSTR("exiting main_()"));

    return EXIT_SUCCESS;
}
开发者ID:alexis-,项目名称:iwe,代码行数:60,代码来源:test.scratch.be.file.cpp

示例3: truncation_test_helper_runtime_test

inline bool truncation_test_helper_runtime_test(FROM from, no_type, TO ) // The use of the dummy variable is to fix a bug with VC++ 5-7.0
{
#ifdef _DEBUG
# if defined(STLSOFT_COMPILER_IS_MSVC)
	int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
	_CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
# endif /* VC++ */

    char const* TO_     =   typeid(TO).name();
    char const* FROM_   =   typeid(FROM).name();

    STLSOFT_SUPPRESS_UNUSED(TO_);
    STLSOFT_SUPPRESS_UNUSED(FROM_);
# if defined(STLSOFT_COMPILER_IS_MSVC)
	_CrtSetDbgFlag(flags);
# endif /* VC++ */
#endif /* _DEBUG */

    // Types are different

    // Next test for same sign
    enum {  TO_is_signed            =   is_signed_type<TO>::value                   };
    enum {  FROM_is_signed          =   is_signed_type<FROM>::value                 };

    enum {  types_have_same_sign    =   int(TO_is_signed) == int(FROM_is_signed)    };

    const ss_size_t sizeofFROM  =   sizeof(FROM);
    const ss_size_t sizeofTO    =   sizeof(TO);

    STLSOFT_STATIC_ASSERT(sizeofFROM >= sizeofTO || FROM_is_signed);

    typedef ss_typename_param_k value_to_yesno_type<types_have_same_sign>::type  same_sign_yesno_t;

    return truncation_test_helper_runtime_test_same_sign<TO>(from, same_sign_yesno_t(), TO());
}
开发者ID:JackieXie168,项目名称:stlsoft,代码行数:35,代码来源:truncation_test.hpp

示例4: truncation_test_v2

    bool truncation_test_v2(FROM from, TO dummy)
    {
#ifdef _DEBUG
        char const  *TO_    =   typeid(TO).name();
        char const  *FROM_  =   typeid(FROM).name();

        STLSOFT_SUPPRESS_UNUSED(TO_);
        STLSOFT_SUPPRESS_UNUSED(FROM_);
#endif /* _DEBUG */

        enum { fromIsSigned =   stlsoft::is_signed_type<FROM>::value    };
        enum { toIsSigned   =   stlsoft::is_signed_type<TO>::value      };

        enum
        {
            is_statically_determined =  
                (   int(fromIsSigned) == int(toIsSigned) &&
                    sizeof(FROM) <= sizeof(TO)) ||
                (   !fromIsSigned &&
                    toIsSigned &&
                    sizeof(FROM) < sizeof(TO))
        };

        typedef ss_typename_type_k value_to_yesno_type<is_statically_determined>::type  yesno_t;

        return truncation_test_v2_is_statically_determined(from, dummy, yesno_t());
    }
开发者ID:synesissoftware,项目名称:STLSoft-1.10-delta,代码行数:27,代码来源:test.performance.stlsoft.conversion.truncation_test.cpp

示例5: pantheios_be_WindowsMessageBox_init_

static int pantheios_be_WindowsMessageBox_init_(
    pan_char_t const*   processIdentity
,   int                 id
,   void const*         unused
,   void*               reserved
,   void**              ptoken
)
{
    STLSOFT_SUPPRESS_UNUSED(unused);
    STLSOFT_SUPPRESS_UNUSED(reserved);

    // (iii) create the context

    WindowsMessageBox_Context* ctxt = new(processIdentity) WindowsMessageBox_Context(id);

#ifndef STLSOFT_CF_THROW_BAD_ALLOC
    if(NULL == ctxt)
    {
        return PANTHEIOS_INIT_RC_OUT_OF_MEMORY;
    }
#endif /* !STLSOFT_CF_THROW_BAD_ALLOC */

    *ptoken = ctxt;

    return 0;
}
开发者ID:wqjkdqj,项目名称:Palabos,代码行数:26,代码来源:bec.WindowsMessageBox.cpp

示例6: main

int main(int argc, char **argv)
{
  // Use of be.file involves several steps:
  //
  // 1. Linking to the back-end, either explicitly or implicitly
  // 2. Setting the log file path for the given back-end(s)
  // 3. Making log statements
  // 4. Changing the log file path for the given back-end(s)
  // 5. Closing the log file for the given back-end(s)

  // In this case, linking is performed either by the build makefile or the
  // IDE project file, to the be.file back-end.
  //
  // In this case, the log file path via the application-defined callback
  // function pantheios_be_file_getAppInit(), which is called during program
  // initialisation, prior to main() being called. At the same time, the
  // flags PANTHEIOS_BE_FILE_F_TRUNCATE and
  // PANTHEIOS_BE_FILE_F_DELETE_IF_EMPTY are specified
  //
  // In this case, the file is closed automatically during program
  // uninitialisation.

  try
  {
#ifndef PANTHEIOS_USE_WIDE_STRINGS
    pantheios::log_DEBUG("main(", pantheios::args(argc, argv), ")");
#else /* ? !PANTHEIOS_USE_WIDE_STRINGS */
    STLSOFT_SUPPRESS_UNUSED(argc); STLSOFT_SUPPRESS_UNUSED(argv);
#endif /* !PANTHEIOS_USE_WIDE_STRINGS */

    pantheios::log_NOTICE(PSTR("stmt 1"));


    pantheios::log_NOTICE(PSTR("stmt 2"));


    pantheios::log_NOTICE(PSTR("stmt 3"));


    pantheios::log_NOTICE(PSTR("stmt 4"));

    pantheios::log_DEBUG(PSTR("exiting main()"));

    return EXIT_SUCCESS;
  }
  catch(std::bad_alloc&)
  {
    pantheios::log(pantheios::alert, PSTR("out of memory"));
  }
  catch(std::exception& x)
  {
    pantheios::log_CRITICAL(PSTR("Exception: "), x);
  }
  catch(...)
  {
    pantheios::logputs(pantheios::emergency, PSTR("Unexpected unknown error"));
  }

  return EXIT_FAILURE;
}
开发者ID:alexis-,项目名称:iwe,代码行数:60,代码来源:example.cpp.backends.file.callback.cpp

示例7: truncation_test_helper_runtime_test_same_sign

inline bool truncation_test_helper_runtime_test_same_sign(FROM from, no_type, TO)
{
#ifdef _DEBUG
# if defined(STLSOFT_COMPILER_IS_MSVC)
	int const flags = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG);
	_CrtSetDbgFlag(flags & ~(_CRTDBG_ALLOC_MEM_DF));
# endif /* VC++ */

    char const* TO_     =   typeid(TO).name();
    char const* FROM_   =   typeid(FROM).name();

    STLSOFT_SUPPRESS_UNUSED(TO_);
    STLSOFT_SUPPRESS_UNUSED(FROM_);
# if defined(STLSOFT_COMPILER_IS_MSVC)
	_CrtSetDbgFlag(flags);
# endif /* VC++ */
#endif /* _DEBUG */

    enum {  TO_is_signed            =   is_signed_type<TO>::value                   };
    enum {  FROM_is_signed          =   is_signed_type<FROM>::value                 };

    const ss_size_t sizeofFROM  =   sizeof(FROM);
    const ss_size_t sizeofTO    =   sizeof(TO);

    STLSOFT_SUPPRESS_UNUSED(sizeofFROM);
    STLSOFT_SUPPRESS_UNUSED(sizeofTO);

    STLSOFT_STATIC_ASSERT((0 == int(TO_is_signed)) != (0 == int(FROM_is_signed)));

    typedef ss_typename_param_k value_to_yesno_type<FROM_is_signed>::type  same_sign_yesno_t;

    return truncation_test_helper_runtime_test_different_sign_FROM_is_signed<TO>(from, same_sign_yesno_t(), TO());
}
开发者ID:JackieXie168,项目名称:stlsoft,代码行数:33,代码来源:truncation_test.hpp

示例8: main_

static int main_(int argc, char **argv)
{
    STLSOFT_SUPPRESS_UNUSED(argc);
    STLSOFT_SUPPRESS_UNUSED(argv);

    some_logging_1();
    some_logging_2();
    some_logging_3();

    return 0;
}
开发者ID:aardvarkk,项目名称:Pantheios,代码行数:11,代码来源:test.scratch.c_api.c

示例9: PANTHEIOS_CALL

PANTHEIOS_CALL(int) pantheios_fe_init(
    void*   reserved
,   void**  ptoken
)
{
    STLSOFT_SUPPRESS_UNUSED(reserved);
    STLSOFT_SUPPRESS_UNUSED(ptoken);

    ++s_numInits;

    return 0;
}
开发者ID:synesissoftware,项目名称:Pantheios,代码行数:12,代码来源:test.component.core.getProcessIdentity.c

示例10: main_

static int main_(int argc, char** argv)
{
  // This goes only to debugger
#ifndef PANTHEIOS_USE_WIDE_STRINGS
  pantheios::log_NOTICE(PSTR("main("), pantheios::args(argc, argv), PSTR(")"));
#else /* ? !PANTHEIOS_USE_WIDE_STRINGS */
  STLSOFT_SUPPRESS_UNUSED(argc); STLSOFT_SUPPRESS_UNUSED(argv);
#endif /* !PANTHEIOS_USE_WIDE_STRINGS */


  // This goes to console and debugger
  pantheios::log(pantheios::notice(beid_Syslog), PSTR("Isn't targeted multiplexing great?!"));

  return EXIT_SUCCESS;
}
开发者ID:DoraXBMC,项目名称:Pantheios,代码行数:15,代码来源:example.cpp.backends.mx.1.cpp

示例11: PANTHEIOS_CALL

PANTHEIOS_CALL(int) pantheios_be_null_logEntry(
    void*               feToken
,   void*               beToken
,   int                 severity
,   pan_char_t const*   entry
,   size_t              cchEntry
)
{
    STLSOFT_SUPPRESS_UNUSED(feToken);
    STLSOFT_SUPPRESS_UNUSED(beToken);
    STLSOFT_SUPPRESS_UNUSED(severity);
    STLSOFT_SUPPRESS_UNUSED(entry);

    return (int)cchEntry;
}
开发者ID:DoraXBMC,项目名称:Pantheios,代码行数:15,代码来源:bec.null.c

示例12: SHWILD_ASSERT

void MatchEnd::setNext(Match *next)
{
    SHWILD_ASSERT(NULL == next);
    SHWILD_MESSAGE_ASSERT("WildEnd must always be the end", 0);

    STLSOFT_SUPPRESS_UNUSED(next);
}
开发者ID:JerYme,项目名称:fastformat,代码行数:7,代码来源:matches.cpp

示例13: PANTHEIOS_CALL

PANTHEIOS_CALL(void) pantheios_fe_uninit(
    void* token
)
{
    PANTHEIOS_CONTRACT_ENFORCE_PRECONDITION_PARAMS_API(NULL == token, "token must be null");
    STLSOFT_SUPPRESS_UNUSED(token);
}
开发者ID:DoraXBMC,项目名称:Pantheios,代码行数:7,代码来源:fe.simple.c

示例14: get_systeminfo_

    /// Unfortunately, something in this technique scares the Borland compilers (5.5
    /// and 5.51) into Internal compiler errors so the s_init variable in
    /// get_systeminfo_() is int rather than bool when compiling for borland.
    static SYSTEM_INFO const& get_systeminfo_()
    {
#if defined(STLSOFT_COMPILER_IS_MSVC) && \
    _MSC_VER >= 1310
  // Safe to suppress these warnings, because race-conditions are benign here
# pragma warning(push)
# pragma warning(disable : 4640)
#endif /* compiler */

        static SYSTEM_INFO  s_systeminfo;
#ifdef STLSOFT_COMPILER_IS_BORLAND
        /* WSCB: Borland has an internal compiler error if use ws_bool_t */
        static ws_int_t     s_init = (::GetSystemInfo(&s_systeminfo), ws_true_v);
#else /* ? compiler */
        static ws_bool_t    s_init = (::GetSystemInfo(&s_systeminfo), ws_true_v);
#endif /* compiler */

        STLSOFT_SUPPRESS_UNUSED(s_init);

        return s_systeminfo;

#if defined(STLSOFT_COMPILER_IS_MSVC) && \
    _MSC_VER >= 1310
# pragma warning(pop)
#endif /* compiler */
    }
开发者ID:JerYme,项目名称:stlsoft,代码行数:29,代码来源:system_info.hpp

示例15: defined

inline /* static */ OSVERSIONINFO &system_version::get_versioninfo_()
{
    /// Unfortunately, something in this technique scares the Borland compilers (5.5
    /// and 5.51) into Internal compiler errors so the s_init variable in
    /// get_versioninfo_() is int rather than bool when compiling for borland.

#if !defined(STLSOFT_STRICT) && \
    defined(STLSOFT_COMPILER_IS_MSVC) && \
    _MSC_VER >= 1310
# pragma warning(push)
# pragma warning(disable : 4640)   /* "construction of local static object is not thread-safe" - since it is here! (As long as one uses a 'conformant' allocator) - maybe use a spin_mutex in future */
#endif /* compiler */

    static OSVERSIONINFO    s_versioninfo;
#if defined(STLSOFT_COMPILER_IS_BORLAND)
    /* WSCB: Borland has an internal compiler error if use ws_bool_t */
    static ws_int_t         s_init = (s_versioninfo.dwOSVersionInfoSize = sizeof(s_versioninfo), ::GetVersionEx(&s_versioninfo), ws_true_v);
#else /* ? compiler */
    static ws_bool_t        s_init = (s_versioninfo.dwOSVersionInfoSize = sizeof(s_versioninfo), ::GetVersionEx(&s_versioninfo), ws_true_v);
#endif /* compiler */

#if !defined(STLSOFT_STRICT) && \
    defined(STLSOFT_COMPILER_IS_MSVC) && \
    _MSC_VER >= 1310
# pragma warning(pop)
#endif /* compiler */

    STLSOFT_SUPPRESS_UNUSED(s_init); // Placate GCC

    return s_versioninfo;
}
开发者ID:JackieXie168,项目名称:stlsoft,代码行数:31,代码来源:system_version.hpp


注:本文中的STLSOFT_SUPPRESS_UNUSED函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。