if ( stream == 0 )
stream = stderr;
- fprintf(stream, "Frame: %06lu, %7lu bytes", m_FrameNumber, m_Size);
+ fprintf(stream, "Frame: %06u, %7u bytes", m_FrameNumber, m_Size);
fputc('\n', stream);
if ( stream == 0 )
stream = stderr;
- fprintf(stream, "Frame: %06lu, %c%-2hu, %7lu bytes",
+ fprintf(stream, "Frame: %06u, %c%-2hu, %7u bytes",
m_FrameNumber, FrameTypeChar(m_FrameType), m_TemporalOffset, m_Size);
if ( m_GOPStart )
if ( stream == 0 )
stream = stderr;
- fprintf(stream, "Frame: %06lu, %7lu bytes\n",
+ fprintf(stream, "Frame: %06u, %7u bytes\n",
m_FrameNumber, m_Size);
if ( dump_len )
}
else
{
- fprintf(stream, " IndexEntryArray: %lu entries\n", IndexEntryArray.size());
+ fprintf(stream, " IndexEntryArray: %u entries\n", IndexEntryArray.size());
}
}
if ( Marker.m_DataSize != 0 && Marker.m_DataSize < 3 )
{
- DefaultLogSink().Error("Illegal data size: %lu\n", Marker.m_DataSize);
+ DefaultLogSink().Error("Illegal data size: %u\n", Marker.m_DataSize);
return ASDCP::RESULT_FAIL;
}
fprintf(stream, "SIZ: \n");
fprintf(stream, " Rsize: %hu\n", Rsize());
- fprintf(stream, " Xsize: %lu\n", Xsize());
- fprintf(stream, " Ysize: %lu\n", Xsize());
- fprintf(stream, " XOsize: %lu\n", XOsize());
- fprintf(stream, " YOsize: %lu\n", XOsize());
- fprintf(stream, " XTsize: %lu\n", XTsize());
- fprintf(stream, " YTsize: %lu\n", XTsize());
- fprintf(stream, "XTOsize: %lu\n", XTOsize());
- fprintf(stream, "YTOsize: %lu\n", YTOsize());
- fprintf(stream, " Csize: %lu\n", Csize());
+ fprintf(stream, " Xsize: %u\n", Xsize());
+ fprintf(stream, " Ysize: %u\n", Xsize());
+ fprintf(stream, " XOsize: %u\n", XOsize());
+ fprintf(stream, " YOsize: %u\n", XOsize());
+ fprintf(stream, " XTsize: %u\n", XTsize());
+ fprintf(stream, " YTsize: %u\n", XTsize());
+ fprintf(stream, "XTOsize: %u\n", XTOsize());
+ fprintf(stream, "YTOsize: %u\n", YTOsize());
+ fprintf(stream, " Csize: %u\n", Csize());
if ( Csize() > 0 )
{
{
ImageComponent TmpComp;
ReadComponent(i, TmpComp);
- fprintf(stream, "%lu: ", i);
- fprintf(stream, "%lu, %lu, %lu\n", TmpComp.Ssize, TmpComp.XRsize, TmpComp.YRsize);
+ fprintf(stream, "%u: ", i);
+ fprintf(stream, "%u, %u, %u\n", TmpComp.Ssize, TmpComp.XRsize, TmpComp.YRsize);
}
}
}
if ( FB.Capacity() < file_size )
{
- DefaultLogSink().Error("FrameBuf.Capacity: %lu frame length: %lu\n", FB.Capacity(), (ui32_t)file_size);
+ DefaultLogSink().Error("FrameBuf.Capacity: %u frame length: %u\n", FB.Capacity(), (ui32_t)file_size);
return RESULT_SMALLBUF;
}
}
{
result = GetNextMarker(&p, NextMarker);
#if 0
- fprintf(stderr, "%s Length: %lu\n",
+ fprintf(stderr, "%s Length: %u\n",
GetMarkerString(NextMarker.m_Type), NextMarker.m_DataSize);
#endif
if ( m_PDesc.Csize != 3 )
{
- DefaultLogSink().Error("Unexpected number of components: %lu\n", m_PDesc.Csize);
+ DefaultLogSink().Error("Unexpected number of components: %u\n", m_PDesc.Csize);
return RESULT_RAW_FORMAT;
}
case MRK_COD:
if ( NextMarker.m_DataSize > DefaultCodingDataLength )
{
- DefaultLogSink().Error("Unexpectedly large CodingStyle data: %lu\n", NextMarker.m_DataSize);
+ DefaultLogSink().Error("Unexpectedly large CodingStyle data: %u\n", NextMarker.m_DataSize);
return RESULT_RAW_FORMAT;
}
case MRK_QCD:
if ( NextMarker.m_DataSize > DefaultCodingDataLength )
{
- DefaultLogSink().Error("Unexpectedly large QuantDefault data: %lu\n", NextMarker.m_DataSize);
+ DefaultLogSink().Error("Unexpectedly large QuantDefault data: %u\n", NextMarker.m_DataSize);
return RESULT_RAW_FORMAT;
}
fprintf(stream, "%02x.", m_KeyStart[i]);
const MDDEntry* Entry = Dict::FindUL(m_KeyStart);
- fprintf(stream, "\b len: %7lu (%s)\n", m_ValueLength, (Entry ? Entry->name : "Unknown"));
+ fprintf(stream, "\b len: %7u (%s)\n", m_ValueLength, (Entry ? Entry->name : "Unknown"));
if ( show_hex && m_ValueLength < 1000 )
Kumu::hexdump(m_ValueStart, Kumu::xmin(m_ValueLength, (ui32_t)64), stream);
if ( read_count < (SMPTE_UL_LENGTH + 1) )
{
- DefaultLogSink().Error("Short read of Key and Length got %lu\n", read_count);
+ DefaultLogSink().Error("Short read of Key and Length got %u\n", read_count);
return RESULT_READFAIL;
}
{
if ( read_count < tmp_read_size )
{
- DefaultLogSink().Error("Short read of packet body, expecting %lu, got %lu\n",
+ DefaultLogSink().Error("Short read of packet body, expecting %u, got %u\n",
m_Buffer.Size(), read_count);
return RESULT_READFAIL;
}
if ( read_count != remainder )
{
- DefaultLogSink().Error("Short read of packet body, expecting %lu, got %lu\n",
+ DefaultLogSink().Error("Short read of packet body, expecting %u, got %u\n",
remainder+tmp_read_size, read_count+tmp_read_size);
result = RESULT_READFAIL;
}
if ( iov->m_Count >= IOVecMaxEntries )
{
- DefaultLogSink().Error("The iovec is full! Only %lu entries allowed before a flush.\n",
+ DefaultLogSink().Error("The iovec is full! Only %u entries allowed before a flush.\n",
IOVecMaxEntries);
return RESULT_FAIL;
}
{ // sanity check BER length
if ( ber_len > 9 )
{
- DefaultLogSink().Error("BER size %lu exceeds maximum size of 9\n", ber_len);
+ DefaultLogSink().Error("BER size %u exceeds maximum size of 9\n", ber_len);
return false;
}
if ( val & ber_masks[ber_len - 1] )
{
ui64Printer tmp_i(val);
- DefaultLogSink().Error("BER size %lu too small for value %s\n", tmp_i.c_str());
+ DefaultLogSink().Error("BER size %u too small for value %s\n", tmp_i.c_str());
return false;
}
}
ui32_t TZ_mm = atoi(datestr + 23);
if ( TZ_mm != 0 )
- DefaultLogSink().Error("Ignoring sub-hours timezone offset: %lu\n", TZ_mm);
+ DefaultLogSink().Error("Ignoring sub-hours timezone offset: %u\n", TZ_mm);
if ( TZ_hh > 12 )
DefaultLogSink().Error("Ignoring large timezone offset: %s\n", (datestr+19));
case GOP_START: result = m_Delegate->GOP(this, m_HBuf, m_HBufLen); break;
default:
- DefaultLogSink().Error("Unexpected start code: %02x at byte %lu\n",
+ DefaultLogSink().Error("Unexpected start code: %02x at byte %u\n",
m_HBuf[3], (ui32_t)(p - buf));
result = RESULT_RAW_FORMAT;
}
{
if ( FB.Capacity() < ( write_offset + VESReadSize ) )
{
- DefaultLogSink().Error("FrameBuf.Capacity: %lu FrameLength: %lu\n",
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %u\n",
FB.Capacity(), ( write_offset + VESReadSize ));
return RESULT_SMALLBUF;
}
KLVFilePacket::Dump(stream, false);
fprintf(stream, " MajorVersion = %hu\n", MajorVersion);
fprintf(stream, " MinorVersion = %hu\n", MinorVersion);
- fprintf(stream, " KAGSize = %lu\n", KAGSize);
+ fprintf(stream, " KAGSize = %u\n", KAGSize);
fprintf(stream, " ThisPartition = %s\n", ui64sz(ThisPartition, identbuf));
fprintf(stream, " PreviousPartition = %s\n", ui64sz(PreviousPartition, identbuf));
fprintf(stream, " FooterPartition = %s\n", ui64sz(FooterPartition, identbuf));
fprintf(stream, " HeaderByteCount = %s\n", ui64sz(HeaderByteCount, identbuf));
fprintf(stream, " IndexByteCount = %s\n", ui64sz(IndexByteCount, identbuf));
- fprintf(stream, " IndexSID = %lu\n", IndexSID);
+ fprintf(stream, " IndexSID = %u\n", IndexSID);
fprintf(stream, " BodyOffset = %s\n", ui64sz(BodyOffset, identbuf));
- fprintf(stream, " BodySID = %lu\n", BodySID);
+ fprintf(stream, " BodySID = %u\n", BodySID);
fprintf(stream, " OperationalPattern = %s\n", OperationalPattern.EncodeString(identbuf, IdentBufferLen));
fputs("Essence Containers:\n", stream); EssenceContainers.Dump(stream, false);
stream = stderr;
KLVPacket::Dump(stream, false);
- fprintf(stream, "Primer: %lu %s\n",
+ fprintf(stream, "Primer: %u %s\n",
LocalTagEntryBatch.size(),
( LocalTagEntryBatch.size() == 1 ? "entry" : "entries" ));
InterchangeObject::Dump(stream);
fprintf(stream, " %22s = %s\n", "LastModifiedDate", LastModifiedDate.EncodeString(identbuf, IdentBufferLen));
fprintf(stream, " %22s = %hu\n", "Version", Version);
- fprintf(stream, " %22s = %lu\n", "ObjectModelVersion", ObjectModelVersion);
+ fprintf(stream, " %22s = %u\n", "ObjectModelVersion", ObjectModelVersion);
fprintf(stream, " %22s = %s\n", "PrimaryPackage", PrimaryPackage.EncodeHex(identbuf, IdentBufferLen));
fprintf(stream, " %22s:\n", "Identifications"); Identifications.Dump(stream);
fprintf(stream, " %22s = %s\n", "ContentStorage", ContentStorage.EncodeHex(identbuf, IdentBufferLen));
{
// OP-Atom states that there will be either two or three partitions,
// one closed header and one closed footer with an optional body
- DefaultLogSink().Error("RIP count is not 2 or 3: %lu\n", test_s);
+ DefaultLogSink().Error("RIP count is not 2 or 3: %u\n", test_s);
return RESULT_FORMAT;
}
else
if ( ASDCP_SUCCESS(result) )
{
if ( HeaderByteCount < 1024 )
- DefaultLogSink().Warn("Improbably small HeaderByteCount value: %lu\n", HeaderByteCount);
+ DefaultLogSink().Warn("Improbably small HeaderByteCount value: %u\n", HeaderByteCount);
result = m_Buffer.Capacity(HeaderByteCount);
}
if ( ASDCP_SUCCESS(result) && read_count != m_Buffer.Capacity() )
{
- DefaultLogSink().Error("Short read of OP-Atom header metadata; wanted %lu, got %lu\n",
+ DefaultLogSink().Error("Short read of OP-Atom header metadata; wanted %u, got %u\n",
m_Buffer.Capacity(), read_count);
return RESULT_FAIL;
}
if ( HeaderSize < 4096 )
{
- DefaultLogSink().Error("HeaderSize %lu is too small. Must be >= 4096\n", HeaderSize);
+ DefaultLogSink().Error("HeaderSize %u is too small. Must be >= 4096\n", HeaderSize);
return RESULT_FAIL;
}
if ( pos > (Kumu::fpos_t)HeaderByteCount )
{
char intbuf[IntBufferLen];
- DefaultLogSink().Error("Header size %s exceeds specified value %lu\n",
+ DefaultLogSink().Error("Header size %s exceeds specified value %u\n",
ui64sz(pos, intbuf),
HeaderSize);
return RESULT_FAIL;
if ( ASDCP_SUCCESS(result) && read_count != m_Buffer.Capacity() )
{
- DefaultLogSink().Error("Short read of footer partition: got %lu, expecting %lu\n",
+ DefaultLogSink().Error("Short read of footer partition: got %u, expecting %u\n",
read_count, m_Buffer.Capacity());
return RESULT_FAIL;
}
if ( FB.Capacity() < m_FrameBufferSize )
{
- DefaultLogSink().Error("FrameBuf.Capacity: %lu FrameLength: %lu\n",
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %u\n",
FB.Capacity(), m_FrameBufferSize);
return RESULT_SMALLBUF;
}
{
if ( chunk_size > RIFF_len )
{
- DefaultLogSink().Error("Chunk size %lu larger than file: %lu\n", chunk_size, RIFF_len);
+ DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
return RESULT_RAW_FORMAT;
}
{
if ( chunk_size > RIFF_len )
{
- DefaultLogSink().Error("Chunk size %lu larger than file: %lu\n", chunk_size, RIFF_len);
+ DefaultLogSink().Error("Chunk size %u larger than file: %u\n", chunk_size, RIFF_len);
return RESULT_RAW_FORMAT;
}
data_len = chunk_size - 8;
*data_start = (p - buf) + offset;
- fprintf(stderr, "*data_start: %p\n", *data_start);
break;
}
else
int
main()
{
- printf("%lu.%lu.%lu", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
+ printf("%u.%u.%u", VERSION_MAJOR, VERSION_APIMINOR, VERSION_IMPMINOR);
return 0;
}
if ( ASDCP_FAILURE(m_FooterPart.Lookup(FrameNum, TmpEntry)) )
{
- DefaultLogSink().Error("Frame value out of range: %lu\n", FrameNum);
+ DefaultLogSink().Error("Frame value out of range: %u\n", FrameNum);
return RESULT_RANGE;
}
if ( FrameBuf.Capacity() < SourceLength )
{
- DefaultLogSink().Error("FrameBuf.Capacity: %lu SourceLength: %lu\n", FrameBuf.Capacity(), SourceLength);
+ DefaultLogSink().Error("FrameBuf.Capacity: %u SourceLength: %u\n", FrameBuf.Capacity(), SourceLength);
return RESULT_SMALLBUF;
}
// read ESV length
if ( ! Kumu::read_test_BER(&ess_p, esv_length) )
{
- DefaultLogSink().Error("read_test_BER did not return %lu\n", esv_length);
+ DefaultLogSink().Error("read_test_BER did not return %u\n", esv_length);
return RESULT_FORMAT;
}
else // return ciphertext to caller
{
if ( FrameBuf.Capacity() < tmp_len )
- return RESULT_SMALLBUF;
+ {
+ char intbuf[IntBufferLen];
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %s\n",
+ FrameBuf.Capacity(), ui64sz(PacketLength, intbuf));
+ return RESULT_SMALLBUF;
+ }
memcpy(FrameBuf.Data(), ess_p, tmp_len);
FrameBuf.Size(tmp_len);
if ( FrameBuf.Capacity() < PacketLength )
{
char intbuf[IntBufferLen];
- DefaultLogSink().Error("FrameBuf.Capacity: %lu FrameLength: %s\n",
+ DefaultLogSink().Error("FrameBuf.Capacity: %u FrameLength: %s\n",
FrameBuf.Capacity(), ui64sz(PacketLength, intbuf));
return RESULT_SMALLBUF;
}
if ( Options.verbose_flag )
{
- fprintf(stderr, "48Khz PCM Audio, %s fps (%lu spf)\n", "24",
+ fprintf(stderr, "48Khz PCM Audio, %s fps (%u spf)\n", "24",
PCM::CalcSamplesPerFrame(ADesc));
fputs("AudioDescriptor:\n", stderr);
PCM::AudioDescriptorDump(ADesc);
if ( FrameBuffer.Size() != FrameBuffer.Capacity() )
{
fprintf(stderr, "WARNING: Last frame read was short, PCM input is possibly not frame aligned.\n");
- fprintf(stderr, "Expecting %lu bytes, got %lu.\n", FrameBuffer.Capacity(), FrameBuffer.Size());
+ fprintf(stderr, "Expecting %u bytes, got %u.\n", FrameBuffer.Capacity(), FrameBuffer.Size());
result = RESULT_ENDOFFILE;
continue;
}