Skip to content

Commit

Permalink
Move using declarations into the charls namespace
Browse files Browse the repository at this point in the history
It is conceptual better to only introduce to use them in the charls namespace then instead add these types to the global namespace (even in a single translation unit).
  • Loading branch information
vbaderks committed Sep 28, 2020
1 parent 1b36f0f commit 7527296
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
1 change: 1 addition & 0 deletions CharLS.sln.DotSettings
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Typedefs/@EntryIndexedValue">&lt;NamingElement Priority="17"&gt;&lt;Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"&gt;&lt;type Name="type alias" /&gt;&lt;type Name="typedef" /&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="False" Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/NamingElement&gt;</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CppNaming/Rules/=Union_0020members/@EntryIndexedValue">&lt;NamingElement Priority="12"&gt;&lt;Descriptor Static="Indeterminate" Constexpr="Indeterminate" Const="Indeterminate" Volatile="Indeterminate" Accessibility="NOT_APPLICABLE"&gt;&lt;type Name="union member" /&gt;&lt;/Descriptor&gt;&lt;Policy Inspect="False" Prefix="" Suffix="" Style="aa_bb" /&gt;&lt;/NamingElement&gt;</s:String>
<s:Boolean x:Key="/Default/Environment/CppEnableCppCli/IsEnabled/@EntryValue">False</s:Boolean>
<s:Boolean x:Key="/Default/Environment/SettingsMigration/IsMigratorApplied/=JetBrains_002EReSharper_002EFeature_002EServices_002EDaemon_002ESettings_002EMigration_002ESwaWarningsModeSettingsMigrate/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=alphatest/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=anymap/@EntryIndexedValue">True</s:Boolean>
<s:Boolean x:Key="/Default/UserDictionary/Words/=Bgra/@EntryIndexedValue">True</s:Boolean>
Expand Down
6 changes: 3 additions & 3 deletions src/jpeg_stream_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#include <iomanip>
#include <memory>

using charls::impl::throw_jpegls_error;
namespace charls {

using impl::throw_jpegls_error;
using std::find;
using std::unique_ptr;
using std::vector;

namespace charls {

jpeg_stream_reader::jpeg_stream_reader(byte_stream_info byte_stream_info) noexcept :
byte_stream_{byte_stream_info}
{
Expand Down
4 changes: 2 additions & 2 deletions src/jpeg_stream_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@
#include <cassert>
#include <vector>

namespace charls {

using std::array;
using std::vector;

namespace charls {

jpeg_stream_writer::jpeg_stream_writer(const byte_stream_info& destination) noexcept :
destination_{destination}
{
Expand Down
5 changes: 2 additions & 3 deletions src/jpegls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@
#include <array>
#include <vector>

namespace charls {

using std::array;
using std::make_unique;
using std::unique_ptr;
using std::vector;
using namespace charls;

namespace {

Expand Down Expand Up @@ -63,8 +64,6 @@ unique_ptr<Strategy> make_codec(const Traits& traits, const frame_info& frame_in
} // namespace


namespace charls {

// Lookup tables to replace code with lookup tables.
// To avoid threading issues, all tables are created when the program is loaded.

Expand Down
4 changes: 2 additions & 2 deletions src/jpegls_error.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

#include <string>

namespace charls {

using std::error_category;
using std::string;

namespace charls {

class jpegls_category final : public error_category
{
public:
Expand Down
2 changes: 1 addition & 1 deletion src/scan.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ class jls_codec final : public Strategy
return traits_.compute_reconstructed_sample(predicted_value, error_value);
}

FORCE_INLINE sample_type do_regular(const int32_t qs, int32_t x, const int32_t predicted, encoder_strategy*)
FORCE_INLINE sample_type do_regular(const int32_t qs, const int32_t x, const int32_t predicted, encoder_strategy*)
{
const int32_t sign = bit_wise_sign(qs);
jls_context& context = contexts_[apply_sign(qs, sign)];
Expand Down

0 comments on commit 7527296

Please sign in to comment.