Changeset 200:cde5d01abcff in rrlib_serialization


Ignore:
Timestamp:
06.02.2021 21:22:34 (8 months ago)
Author:
Max Reichardt <mreichardt@…>
Branch:
17.03
Children:
201:74bbac32be99, 202:1af1097a3283
Phase:
public
Message:

Fixes compiler warnings that appear with additional non-default warning options enabled

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • serialization.cpp

    r109 r200  
    111111    uint b1 = bi >> 4u; 
    112112    uint b2 = bi & 0xFu; 
    113     assert((b1 >= 0 && b1 < 16)); 
    114     assert((b2 >= 0 && b2 < 16)); 
     113    assert(b1 < 16); 
     114    assert(b2 < 16); 
    115115    os.Append(cTO_HEX[b1]); 
    116116    os.Append(cTO_HEX[b2]); 
  • tInputStream.cpp

    r187 r200  
    200200    off += read; 
    201201    cur_buffer->position += read; 
    202     assert((len >= 0)); 
    203202    if (len == 0) 
    204203    { 
  • tMemoryBuffer.h

    r168 r200  
    255255  } 
    256256 
    257   virtual void DirectRead(tInputStream& input_stream_buffer, tFixedBuffer& buffer, size_t offset, size_t len) const override; 
     257  __attribute__((__noreturn__)) virtual void DirectRead(tInputStream& input_stream_buffer, tFixedBuffer& buffer, size_t offset, size_t len) const override; 
    258258 
    259259  virtual bool DirectReadSupport() const override 
     
    262262  } 
    263263 
    264   virtual void DirectWrite(tOutputStream& output_stream_buffer, const tFixedBuffer& buffer, size_t offset, size_t len) override; 
     264  __attribute__((__noreturn__)) virtual void DirectWrite(tOutputStream& output_stream_buffer, const tFixedBuffer& buffer, size_t offset, size_t len) override; 
    265265 
    266266  virtual bool DirectWriteSupport() override 
     
    312312  virtual void Reset(tOutputStream& output_stream_buffer, tBufferInfo& buffer) override; 
    313313 
    314   virtual void Seek(tInputStream& input_stream, tBufferInfo& buffer, uint64_t position) const override; 
     314  __attribute__((__noreturn__)) virtual void Seek(tInputStream& input_stream, tBufferInfo& buffer, uint64_t position) const override; 
    315315 
    316316  virtual bool SeekSupport() const override 
  • tOutputStream.cpp

    r190 r200  
    220220        len -= write; 
    221221        off += write; 
    222         assert((len >= 0)); 
    223222        if (len == 0) 
    224223        { 
     
    360359{ 
    361360  size_t len = terminate ? (s.size() + 1) : s.size(); 
    362   Write(tFixedBuffer((char*)s.c_str(), len)); 
     361  Write(tFixedBuffer(const_cast<char*>(s.c_str()), len)); 
    363362} 
    364363 
  • tOutputStream.h

    r198 r200  
    301301  inline void Write(const void* address, size_t size) 
    302302  { 
    303     tFixedBuffer fb((char*)address, size); 
     303    tFixedBuffer fb(static_cast<char*>(const_cast<void*>(address)), size); 
    304304    Write(fb); 
    305305  } 
  • tStringInputStream.cpp

    r175 r200  
    154154            case 8: 
    155155              return signed_value ? static_cast<int64_t>(static_cast<const int64_t*>(enum_strings.non_standard_values)[i]) : static_cast<int64_t>(static_cast<const uint64_t*>(enum_strings.non_standard_values)[i]); 
     156            default: 
     157              throw std::runtime_error("Invalid value size"); 
    156158            } 
    157             throw std::runtime_error("Invalid value size"); 
    158159          } 
    159160          return i; 
Note: See TracChangeset for help on using the changeset viewer.