input/rewind: include cleanup

This commit is contained in:
Max Kellermann
2014-05-21 18:34:29 +02:00
parent dc085e0bd2
commit 542e7feba8

View File

@@ -20,11 +20,9 @@
#include "config.h" #include "config.h"
#include "RewindInputPlugin.hxx" #include "RewindInputPlugin.hxx"
#include "../InputStream.hxx" #include "../InputStream.hxx"
#include "../InputPlugin.hxx"
#include <assert.h> #include <assert.h>
#include <string.h> #include <string.h>
#include <stdio.h>
class RewindInputStream final : public InputStream { class RewindInputStream final : public InputStream {
InputStream *input; InputStream *input;
@@ -161,13 +159,13 @@ RewindInputStream::Read(void *ptr, size_t read_size, Error &error)
} }
inline bool inline bool
RewindInputStream::Seek(InputPlugin::offset_type new_offset, int whence, RewindInputStream::Seek(offset_type new_offset, int whence,
Error &error) Error &error)
{ {
assert(IsReady()); assert(IsReady());
if (whence == SEEK_SET && tail > 0 && if (whence == SEEK_SET && tail > 0 &&
new_offset <= (InputPlugin::offset_type)tail) { new_offset <= (offset_type)tail) {
/* buffered seek */ /* buffered seek */
assert(!ReadingFromBuffer() || assert(!ReadingFromBuffer() ||