Skip to content

Commit

Permalink
Remove deprecated APIs
Browse files Browse the repository at this point in the history
  • Loading branch information
AMDmi3 committed Sep 11, 2019
1 parent 0f10011 commit bfe9427
Show file tree
Hide file tree
Showing 7 changed files with 5 additions and 418 deletions.
3 changes: 1 addition & 2 deletions libversion/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,9 @@ include(GenerateExportHeader)
configure_file(config.h.in config.h @ONLY)

set(LIBVERSION_SOURCES
compare.c
private/compare.c
private/parse.c
signature.c
compare.c
)

set(LIBVERSION_HEADERS
Expand Down
24 changes: 0 additions & 24 deletions libversion/compare.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,27 +81,3 @@ int version_compare4(const char* v1, const char* v2, int v1_flags, int v2_flags)
int version_compare2(const char* v1, const char* v2) {
return version_compare4(v1, v2, 0, 0);
}

/* deprecated */
int version_compare3(const char* v1, const char* v2, int flags) {
return version_compare4(v1, v2, flags, flags);
}

int version_compare_simple(const char* v1, const char* v2) {
return version_compare2(v1, v2);
}

int version_compare_flags(const char* v1, const char* v2, int flags) {
const int v1_flags =
((flags & VERSIONFLAG_P_IS_PATCH_LEFT) ? VERSIONFLAG_P_IS_PATCH : 0) |
((flags & VERSIONFLAG_ANY_IS_PATCH_LEFT) ? VERSIONFLAG_ANY_IS_PATCH : 0);
const int v2_flags =
((flags & VERSIONFLAG_P_IS_PATCH_RIGHT) ? VERSIONFLAG_P_IS_PATCH : 0) |
((flags & VERSIONFLAG_ANY_IS_PATCH_RIGHT) ? VERSIONFLAG_ANY_IS_PATCH : 0);

return version_compare4(v1, v2, v1_flags, v2_flags);
}

int version_compare_flags2(const char* v1, const char* v2, int v1_flags, int v2_flags) {
return version_compare4(v1, v2, v1_flags, v2_flags);
}
99 changes: 0 additions & 99 deletions libversion/signature.c

This file was deleted.

42 changes: 4 additions & 38 deletions libversion/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,49 +38,15 @@ extern "C" {
)

enum {
#ifndef LIBVERSION_NO_DEPRECATED
/* deprecated: use version_compare4() and VERSIONFLAG_P_IS_PATCH */
VERSIONFLAG_P_IS_PATCH_LEFT = 0x1,

/* deprecated: use version_compare4() and VERSIONFLAG_P_IS_PATCH */
VERSIONFLAG_P_IS_PATCH_RIGHT = 0x2,

/* deprecated: use version_compare4() and VERSIONFLAG_ANY_IS_PATCH */
VERSIONFLAG_ANY_IS_PATCH_LEFT = 0x4,

/* deprecated: use version_compare4() and VERSIONFLAG_ANY_IS_PATCH */
VERSIONFLAG_ANY_IS_PATCH_RIGHT = 0x8,
#endif

VERSIONFLAG_P_IS_PATCH = 0x1 | 0x2,
VERSIONFLAG_ANY_IS_PATCH = 0x4 | 0x8,
VERSIONFLAG_LOWER_BOUND = 0x10,
VERSIONFLAG_UPPER_BOUND = 0x20,
VERSIONFLAG_P_IS_PATCH = 0x1,
VERSIONFLAG_ANY_IS_PATCH = 0x2,
VERSIONFLAG_LOWER_BOUND = 0x4,
VERSIONFLAG_UPPER_BOUND = 0x8,
};

extern LIBVERSION_EXPORT int version_compare2(const char* v1, const char* v2);
extern LIBVERSION_EXPORT int version_compare4(const char* v1, const char* v2, int v1_flags, int v2_flags);

#ifndef LIBVERSION_NO_DEPRECATED
/* deprecated */
typedef unsigned long version_signature_t;

/* deprecated */
extern LIBVERSION_DEPRECATED_EXPORT version_signature_t version_signature_simple(const char* v);

/* deprecated, use version_compare2 */
extern LIBVERSION_DEPRECATED_EXPORT int version_compare_simple(const char* v1, const char* v2);

/* deprecated, use version_compare4 */
extern LIBVERSION_DEPRECATED_EXPORT int version_compare_flags(const char* v1, const char* v2, int flags);

/* deprecated, use version_compare4 */
extern LIBVERSION_DEPRECATED_EXPORT int version_compare_flags2(const char* v1, const char* v2, int v1_flags, int v2_flags);

/* deprecated, use version_compare4 */
extern LIBVERSION_DEPRECATED_EXPORT int version_compare3(const char* v1, const char* v2, int flags);
#endif

#ifdef __cplusplus
}
#endif
Expand Down
8 changes: 0 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,5 @@ add_executable(compare_test compare_test.c)
target_link_libraries(compare_test libversion)
add_test(compare_test compare_test)

add_executable(compare_deprecated_test compare_deprecated_test.c)
target_link_libraries(compare_deprecated_test libversion)
add_test(compare_deprecated_test compare_deprecated_test)

add_executable(signature_test signature_test.c)
target_link_libraries(signature_test libversion)
add_test(signature_test signature_test)

add_executable(compare_fuzzer compare_fuzzer.c)
target_link_libraries(compare_fuzzer libversion)
56 changes: 0 additions & 56 deletions tests/compare_deprecated_test.c

This file was deleted.

Loading

0 comments on commit bfe9427

Please sign in to comment.