Consistently use TODO for to-dos.
diff --git a/lib/CMakeLists.txt b/lib/CMakeLists.txt index 262074d..358e212 100644 --- a/lib/CMakeLists.txt +++ b/lib/CMakeLists.txt
@@ -143,7 +143,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR}/..) -# XXX: distribute instead? +# TODO: distribute instead? #ADD_CUSTOM_COMMAND(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c # COMMAND sh ${CMAKE_CURRENT_SOURCE_DIR}/make_zip_err_str.sh # ${CMAKE_CURRENT_SOURCE_DIR}/zip.h
diff --git a/lib/zip_add_entry.c b/lib/zip_add_entry.c index e80f956..5cbc957 100644 --- a/lib/zip_add_entry.c +++ b/lib/zip_add_entry.c
@@ -49,7 +49,7 @@ if (za->nentry+1 >= za->nentry_alloc) { struct zip_entry *rentries; zip_uint64_t nalloc = za->nentry_alloc + 16; - /* XXX check for overflow */ + /* TODO check for overflow */ rentries = (struct zip_entry *)realloc(za->entry, sizeof(struct zip_entry) * (size_t)nalloc); if (!rentries) { _zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
diff --git a/lib/zip_close.c b/lib/zip_close.c index 702b463..e8dd9d6 100644 --- a/lib/zip_close.c +++ b/lib/zip_close.c
@@ -115,13 +115,13 @@ /* archive comment is special for torrentzip */ if (zip_get_archive_flag(za, ZIP_AFL_TORRENT, 0)) { - /* XXX: use internal function when zip_set_archive_comment clears TORRENT flag */ + /* TODO: use internal function when zip_set_archive_comment clears TORRENT flag */ if (zip_set_archive_comment(za, TORRENT_SIG "XXXXXXXX", TORRENT_SIG_LEN + TORRENT_CRC_LEN) < 0) { free(filelist); return -1; } } - /* XXX: if no longer torrentzip and archive comment not changed by user, delete it */ + /* TODO: if no longer torrentzip and archive comment not changed by user, delete it */ /* create list of files with index into original archive */ @@ -189,7 +189,7 @@ _zip_dirent_torrent_normalize(entry->changes); - de->offset = (zip_uint64_t)ftello(out); /* XXX: check for errors */ + de->offset = (zip_uint64_t)ftello(out); /* TODO: check for errors */ if (new_data) { struct zip_source *zs; @@ -367,7 +367,7 @@ return -1; } - /* XXX: deflate 0-byte files for torrentzip? */ + /* TODO: deflate 0-byte files for torrentzip? */ if (de->comp_method != ZIP_CM_STORE && ((st.valid & ZIP_STAT_SIZE) == 0 || st.size != 0)) { if ((comp_impl=_zip_get_compression_implementation(de->comp_method)) == NULL) { _zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); @@ -398,7 +398,7 @@ while (s2 != src) { if ((s2=zip_source_pop(s2)) == NULL) { - /* XXX: set erorr */ + /* TODO: set erorr */ ret = -1; break; }
diff --git a/lib/zip_dirent.c b/lib/zip_dirent.c index 7c6d651..5c5792c 100644 --- a/lib/zip_dirent.c +++ b/lib/zip_dirent.c
@@ -320,7 +320,7 @@ Returns 0 if successful. On error, error is filled in and -1 is returned. - XXX: leftp and file position undefined on error. + TODO: leftp and file position undefined on error. */ int @@ -460,7 +460,7 @@ if (zde->uncomp_size == ZIP_UINT32_MAX || zde->comp_size == ZIP_UINT32_MAX || zde->offset == ZIP_UINT32_MAX) { zip_uint16_t got_len, needed_len; const zip_uint8_t *ef = _zip_ef_get_by_id(zde->extra_fields, &got_len, ZIP_EF_ZIP64, 0, local ? ZIP_EF_LOCAL : ZIP_EF_CENTRAL, error); - /* XXX: if got_len == 0 && !ZIP64_EOCD: no error, 0xffffffff is valid value */ + /* TODO: if got_len == 0 && !ZIP64_EOCD: no error, 0xffffffff is valid value */ if (ef == NULL) return -1; @@ -707,7 +707,7 @@ _zip_write2(is_really_zip64 ? 45 : de->version_madeby, fp); _zip_write2(is_really_zip64 ? 45 : de->version_needed, fp); _zip_write2(de->bitflags&0xfff9, fp); /* clear compression method specific flags */ - _zip_write2((zip_uint16_t)de->comp_method, fp); /* XXX: can it be ZIP_CM_DEFAULT? */ + _zip_write2((zip_uint16_t)de->comp_method, fp); /* TODO: can it be ZIP_CM_DEFAULT? */ _zip_u2d_time(de->last_mod, &dostime, &dosdate); _zip_write2(dostime, fp); @@ -796,7 +796,7 @@ raw = _zip_string_get(str, &len, ZIP_FL_ENC_RAW, NULL); if (len+5 > ZIP_UINT16_MAX) { - /* XXX: error */ + /* TODO: error */ } if ((data=(zip_uint8_t *)malloc(len+5)) == NULL) {
diff --git a/lib/zip_file_get_offset.c b/lib/zip_file_get_offset.c index 65a011f..e8c199f 100644 --- a/lib/zip_file_get_offset.c +++ b/lib/zip_file_get_offset.c
@@ -63,7 +63,7 @@ return 0; } - /* XXX: cache? */ + /* TODO: cache? */ if ((size=_zip_dirent_size(za->zp, ZIP_EF_LOCAL, error)) < 0) return 0;
diff --git a/lib/zip_get_num_files.c b/lib/zip_get_num_files.c index 29b06dc..d75941d 100644 --- a/lib/zip_get_num_files.c +++ b/lib/zip_get_num_files.c
@@ -44,6 +44,6 @@ if (za == NULL) return -1; - /* XXX: check for overflow */ + /* TODO: check for overflow */ return (int)za->nentry; }
diff --git a/lib/zip_set_file_compression.c b/lib/zip_set_file_compression.c index ea8517d..647f69a 100644 --- a/lib/zip_set_file_compression.c +++ b/lib/zip_set_file_compression.c
@@ -63,7 +63,7 @@ old_method = (e->orig == NULL ? ZIP_CM_DEFAULT : e->orig->comp_method); - /* XXX: revisit this when flags are supported, since they may require a recompression */ + /* TODO: revisit this when flags are supported, since they may require a recompression */ if (method == old_method) { if (e->changes) {
diff --git a/lib/zip_set_name.c b/lib/zip_set_name.c index 60c9e7d..02fa127 100644 --- a/lib/zip_set_name.c +++ b/lib/zip_set_name.c
@@ -59,7 +59,7 @@ } if (name && strlen(name) > 0) { - /* XXX: check for string too long */ + /* TODO: check for string too long */ if ((str=_zip_string_new((const zip_uint8_t *)name, (zip_uint16_t)strlen(name), flags, &za->error)) == NULL) return -1; if ((flags & ZIP_FL_ENCODING_ALL) == ZIP_FL_ENC_GUESS && _zip_guess_encoding(str, ZIP_ENCODING_UNKNOWN) == ZIP_ENCODING_UTF8_GUESSED) @@ -68,7 +68,7 @@ else str = NULL; - /* XXX: encoding flags needed for CP437? */ + /* TODO: encoding flags needed for CP437? */ if ((i=_zip_name_locate(za, name, 0, NULL)) >= 0 && (zip_uint64_t)i != idx) { _zip_string_free(str); _zip_error_set(&za->error, ZIP_ER_EXISTS, 0);
diff --git a/lib/zip_source_crc.c b/lib/zip_source_crc.c index 99bc965..7d6df6a 100644 --- a/lib/zip_source_crc.c +++ b/lib/zip_source_crc.c
@@ -125,7 +125,7 @@ } else { ctx->size += (zip_uint64_t)n; - ctx->crc = (zip_uint32_t)crc32(ctx->crc, (const Bytef *)data, (uInt)n); /* XXX: check for overflow, use multiple crc calls if needed */ + ctx->crc = (zip_uint32_t)crc32(ctx->crc, (const Bytef *)data, (uInt)n); /* TODO: check for overflow, use multiple crc calls if needed */ } return n; @@ -139,7 +139,7 @@ st = (struct zip_stat *)data; if (ctx->eof) { - /* XXX: Set comp_size, comp_method, encryption_method? + /* TODO: Set comp_size, comp_method, encryption_method? After all, this only works for uncompressed data. */ st->size = ctx->size; st->crc = ctx->crc;
diff --git a/lib/zip_source_deflate.c b/lib/zip_source_deflate.c index 8799531..57444d9 100644 --- a/lib/zip_source_deflate.c +++ b/lib/zip_source_deflate.c
@@ -113,7 +113,7 @@ return 0; ctx->zstr.next_out = (Bytef *)data; - ctx->zstr.avail_out = (uInt)len; /* XXX: check for overflow */ + ctx->zstr.avail_out = (uInt)len; /* TODO: check for overflow */ end = 0; while (!end) { @@ -144,7 +144,7 @@ else if (n == 0) { ctx->eof = 1; ctx->size = ctx->zstr.total_in; - /* XXX: check against stat of src? */ + /* TODO: check against stat of src? */ } else { ctx->zstr.next_in = (Bytef *)ctx->buffer; @@ -187,7 +187,7 @@ return 0; ctx->zstr.next_out = (Bytef *)data; - ctx->zstr.avail_out = (uInt)len; /* XXX: check for overflow */ + ctx->zstr.avail_out = (uInt)len; /* TODO: check for overflow */ end = 0; while (!end && ctx->zstr.avail_out) { @@ -332,7 +332,7 @@ ctx->zstr.zfree = Z_NULL; ctx->zstr.opaque = NULL; ctx->zstr.next_in = (Bytef *)ctx->buffer; - ctx->zstr.avail_in = (uInt)n /* XXX: check for overflow */; + ctx->zstr.avail_in = (uInt)n /* TODO: check for overflow */; /* negative value to tell zlib that there is no header */ if ((ret=inflateInit2(&ctx->zstr, -MAX_WBITS)) != Z_OK) { @@ -370,7 +370,7 @@ return sizeof(int)*2; case ZIP_SOURCE_FREE: - /* XXX: inflateEnd if close was not called */ + /* TODO: inflateEnd if close was not called */ free(ctx); return 0; @@ -387,6 +387,6 @@ static void deflate_free(struct deflate *ctx) { - /* XXX: deflateEnd if close was not called */ + /* TODO: deflateEnd if close was not called */ free(ctx); }
diff --git a/lib/zip_source_pkware.c b/lib/zip_source_pkware.c index ec53dfe..f6cbf1d 100644 --- a/lib/zip_source_pkware.c +++ b/lib/zip_source_pkware.c
@@ -204,7 +204,7 @@ st->encryption_method = ZIP_EM_NONE; st->valid |= ZIP_STAT_ENCRYPTION_METHOD; - /* XXX: deduce HEADERLEN from size for uncompressed */ + /* TODO: deduce HEADERLEN from size for uncompressed */ if (st->valid & ZIP_STAT_COMP_SIZE) st->comp_size -= HEADERLEN; }
diff --git a/lib/zip_source_zip_new.c b/lib/zip_source_zip_new.c index 8e48f6f..353489a 100644 --- a/lib/zip_source_zip_new.c +++ b/lib/zip_source_zip_new.c
@@ -121,12 +121,12 @@ st2.mtime = st.mtime; st2.valid = ZIP_STAT_SIZE|ZIP_STAT_COMP_SIZE|ZIP_STAT_COMP_METHOD|ZIP_STAT_MTIME; - /* XXX: check for overflow of st2.size */ + /* TODO: check for overflow of st2.size */ if ((src=_zip_source_file_or_p(za, NULL, srcza->zp, offset+start, (zip_int64_t)st2.size, 0, &st2)) == NULL) return NULL; } else { - /* XXX: check for overflow of st.comp_size */ + /* TODO: check for overflow of st.comp_size */ if ((src=_zip_source_file_or_p(za, NULL, srcza->zp, offset, (zip_int64_t)st.comp_size, 0, &st)) == NULL) return NULL; } @@ -134,7 +134,7 @@ if (enc_impl) { if ((s2=enc_impl(za, src, st.encryption_method, 0, password)) == NULL) { zip_source_free(src); - /* XXX: set error (how?) */ + /* TODO: set error (how?) */ return NULL; } src = s2; @@ -142,7 +142,7 @@ if (comp_impl) { if ((s2=comp_impl(za, src, st.comp_method, 0)) == NULL) { zip_source_free(src); - /* XXX: set error (how?) */ + /* TODO: set error (how?) */ return NULL; } src = s2; @@ -152,7 +152,7 @@ /* when reading the whole file, check for crc errors */ if ((s2=zip_source_crc(za, src, 1)) == NULL) { zip_source_free(src); - /* XXX: set error (how?) */ + /* TODO: set error (how?) */ return NULL; } src = s2; @@ -161,7 +161,7 @@ if (start+len > 0 && (comp_impl || enc_impl)) { if ((s2=zip_source_window(za, src, start, len ? len : st.size-start)) == NULL) { zip_source_free(src); - /* XXX: set error (how?) (why?) */ + /* TODO: set error (how?) (why?) */ return NULL; } src = s2;
diff --git a/lib/zip_stat_index.c b/lib/zip_stat_index.c index f4ce72a..2505c80 100644 --- a/lib/zip_stat_index.c +++ b/lib/zip_stat_index.c
@@ -68,7 +68,7 @@ st->comp_method = (zip_uint16_t)de->comp_method; if (de->bitflags & ZIP_GPBF_ENCRYPTED) { if (de->bitflags & ZIP_GPBF_STRONG_ENCRYPTION) { - /* XXX */ + /* TODO */ st->encryption_method = ZIP_EM_UNKNOWN; } else
diff --git a/lib/zip_string.c b/lib/zip_string.c index a2d5eb5..4e8709b 100644 --- a/lib/zip_string.c +++ b/lib/zip_string.c
@@ -64,7 +64,7 @@ if (a->length != b->length) return 0; - /* XXX: encoding */ + /* TODO: encoding */ return (memcmp(a->raw, b->raw, a->length) == 0); }