Skip to content

Commit

Permalink
More cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
bernardnormier committed Oct 30, 2024
1 parent 826afbe commit e92b038
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 21 deletions.
2 changes: 1 addition & 1 deletion cpp/include/Ice/StringConverter.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ namespace Ice
* @param nc The narrow string converter. If null, the UTF-8 string is returned.
* @return A native narrow string.
*/
ICE_API std::string UTF8ToNative(const std::string& str, const StringConverterPtr& nc);
ICE_API std::string UTF8ToNative(std::string_view str, const StringConverterPtr& nc);

#ifdef _WIN32

Expand Down
18 changes: 1 addition & 17 deletions cpp/include/IceBox/Service.h
Original file line number Diff line number Diff line change
@@ -1,21 +1,11 @@
//
// Copyright (c) ZeroC, Inc. All rights reserved.
//
// Copyright (c) ZeroC, Inc.

#ifndef ICEBOX_SERVICE_H
#define ICEBOX_SERVICE_H

#include "Config.h"
#include "Ice/Ice.h"

#if defined(__clang__)
# pragma clang diagnostic push
# pragma clang diagnostic ignored "-Wshadow-field-in-constructor"
#elif defined(__GNUC__)
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wshadow"
#endif

namespace IceBox
{
/**
Expand Down Expand Up @@ -61,10 +51,4 @@ namespace IceBox
using ServicePtr = std::shared_ptr<Service>;
}

#if defined(__clang__)
# pragma clang diagnostic pop
#elif defined(__GNUC__)
# pragma GCC diagnostic pop
#endif

#endif
4 changes: 3 additions & 1 deletion cpp/src/Ice/Service.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,9 @@ namespace
class SMEventLoggerIWrapper final : public Ice::Logger
{
public:
SMEventLoggerIWrapper(const SMEventLoggerPtr& logger, string prefix) : _logger(logger), _prefix(std::move(prefix))
SMEventLoggerIWrapper(const SMEventLoggerPtr& logger, string prefix)
: _logger(logger),
_prefix(std::move(prefix))
{
assert(_logger);
}
Expand Down
4 changes: 2 additions & 2 deletions cpp/src/Ice/StringConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,11 @@ Ice::nativeToUTF8(string_view str, const Ice::StringConverterPtr& converter)
}

string
Ice::UTF8ToNative(const string& str, const Ice::StringConverterPtr& converter)
Ice::UTF8ToNative(string_view str, const Ice::StringConverterPtr& converter)
{
if (!converter || str.empty())
{
return str;
return string{str};
}
string tmp;
converter->fromUTF8(
Expand Down

0 comments on commit e92b038

Please sign in to comment.