decompression. */
uint8_t* filtered_buf; /* Buffer used when applying filters. */
const uint8_t* block_buf; /* Buffer used when merging blocks. */
- size_t window_mask; /* Convinience field; window_size - 1. */
+ size_t window_mask; /* Convenience field; window_size - 1. */
int64_t write_ptr; /* This amount of data has been unpacked in
the window buffer. */
int64_t last_write_ptr; /* This amount of data has been stored in
int skip_mode;
/* An offset to QuickOpen list. This is not supported by this unpacker,
- * becuase we're focusing on streaming interface. QuickOpen is designed
+ * because we're focusing on streaming interface. QuickOpen is designed
* to make things quicker for non-stream interfaces, so it's not our
* use case. */
uint64_t qlist_offset;
d->size--;
}
-/* Pops a front element of this cicrular deque object and returns its value.
+/* Pops a front element of this circular deque object and returns its value.
* This function performs bounds checking. */
static int cdeque_pop_front(struct cdeque* d, void** value) {
if(!d || !value)
return CDE_OK;
}
-/* Convinience function to cast filter_info** to void **. */
+/* Convenience function to cast filter_info** to void **. */
static void** cdeque_filter_p(struct filter_info** f) {
return (void**) (size_t) f;
}
-/* Convinience function to cast filter_info* to void *. */
+/* Convenience function to cast filter_info* to void *. */
static void* cdeque_filter(struct filter_info* f) {
return (void**) (size_t) f;
}
-/* Destroys this circular deque object. Dellocates the memory of the collection
+/* Destroys this circular deque object. Deallocates the memory of the collection
* buffer, but doesn't deallocate the memory of any pointer passed to this
* deque as a value. */
static void cdeque_free(struct cdeque* d) {
// TODO: make sure these functions return a little endian number
-/* Convinience functions used by filter implementations. */
+/* Convenience functions used by filter implementations. */
static uint32_t read_filter_data(struct rar5* rar, uint32_t offset) {
uint32_t* dptr = (uint32_t*) &rar->cstate.window_buf[offset];
}
}
-/* Convinience function that submits the data to the user. It uses the
+/* Convenience function that submits the data to the user. It uses the
* unpack window buffer as a source location. */
static void push_window_data(struct archive_read* a, struct rar5* rar,
int64_t idx_begin, int64_t idx_end)
/* Free any remaining filters. All filters should be naturally consumed by
* the unpacking function, so remaining filters after unpacking normally
- * mean that unpacking wasn't successfull. But still of course we shouldn't
+ * mean that unpacking wasn't successful. But still of course we shouldn't
* leak memory in such case. */
/* cdeque_size() is a fast operation, so we can use it as a loop
* it will not have the possibility to advance the file
* pointer, because it will not know how many bytes it needs
* to consume. This is why we handle such situation here
- * autmatically. */
+ * automatically. */
if(ARCHIVE_OK != consume(a, 1 + i)) {
return 0;
}
enum MAIN_FLAGS {
VOLUME = 0x0001, /* multi-volume archive */
- VOLUME_NUMBER = 0x0002, /* volume number, first vol doesnt have it */
+ VOLUME_NUMBER = 0x0002, /* volume number, first vol doesn't have it */
SOLID = 0x0004, /* solid archive */
PROTECT = 0x0008, /* contains Recovery info */
LOCK = 0x0010, /* readonly flag, not used */
return ARCHIVE_OK;
}
-/* Convinience function used during filter processing. */
+/* Convenience function used during filter processing. */
static int parse_filter_data(struct rar5* rar, const uint8_t* p,
uint32_t* filter_data)
{
* data and discarding the result). */
if(!rar->skip_mode) {
- /* Always check checkums if we're not in skip mode */
+ /* Always check checksums if we're not in skip mode */
verify_crc = 1;
} else {
/* We can override the logic above with a compile-time option