From cf4b7963a47319f2942e80bfa6612bd0d4df2c08 Mon Sep 17 00:00:00 2001 From: tqfx Date: Mon, 26 Feb 2024 22:48:18 +0800 Subject: [PATCH] rename other to that --- java/src/liba/version.java | 28 ++++++++++++++-------------- java/src/version.c | 42 +++++++++++++++++++++--------------------- javascript/liba.d.ts | 28 ++++++++++++++-------------- liba.pyi | 14 +++++++------- lua/src/complex.h | 8 ++++---- lua/src/version.h | 34 +++++++++++++++++----------------- python/src/a/version.pxi | 28 ++++++++++++++-------------- quickjs/src/version.c | 42 +++++++++++++++++++++--------------------- src/lib.rs | 24 ++++++++++++------------ 9 files changed, 124 insertions(+), 124 deletions(-) diff --git a/java/src/liba/version.java b/java/src/liba/version.java index ce3efa2..0b5693a 100644 --- a/java/src/liba/version.java +++ b/java/src/liba/version.java @@ -144,57 +144,57 @@ public class version { public final native version parse(String ver); /** - * this version is less than other version + * this version is less than that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean lt(version ver); /** - * this version is greater than other version + * this version is greater than that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean gt(version ver); /** - * this version is less than or equal to other version + * this version is less than or equal to that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean le(version ver); /** - * this version is greater than or equal to other version + * this version is greater than or equal to that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean ge(version ver); /** - * this version is equal to other version + * this version is equal to that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean eq(version ver); /** - * this version is not equal to other version + * this version is not equal to that version * - * @param ver other version to be compared + * @param ver version to be compared * @return result of comparison */ public final native boolean ne(version ver); /** - * compare this version with other versions + * compare this version with that version * - * @param ver other version to be compared + * @param ver version to be compared * @return relationship between the versions */ public final native int cmp(version ver); diff --git a/java/src/version.c b/java/src/version.c index 3e4004c..acb9837 100644 --- a/java/src/version.c +++ b/java/src/version.c @@ -106,64 +106,64 @@ JNIEXPORT jobject JNICALL Java_liba_version_parse(JNIEnv *_env, jobject _obj, js JNIEXPORT jboolean JNICALL Java_liba_version_lt(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_lt(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_lt(ctx, rhs); } JNIEXPORT jboolean JNICALL Java_liba_version_gt(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_gt(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_gt(ctx, rhs); } JNIEXPORT jboolean JNICALL Java_liba_version_le(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_le(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_le(ctx, rhs); } JNIEXPORT jboolean JNICALL Java_liba_version_ge(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_ge(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_ge(ctx, rhs); } JNIEXPORT jboolean JNICALL Java_liba_version_eq(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_eq(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_eq(ctx, rhs); } JNIEXPORT jboolean JNICALL Java_liba_version_ne(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_ne(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_ne(ctx, rhs); } JNIEXPORT jint JNICALL Java_liba_version_cmp(JNIEnv *_env, jobject _obj, jobject _ver) { jobject _ctx = (*_env)->GetObjectField(_env, _obj, L.ctx); - jobject _other = (*_env)->GetObjectField(_env, _ver, L.ctx); + jobject _rhs = (*_env)->GetObjectField(_env, _ver, L.ctx); a_version *ctx = (a_version *)(*_env)->GetDirectBufferAddress(_env, _ctx); - a_version *other = (a_version *)(*_env)->GetDirectBufferAddress(_env, _other); - return a_version_cmp(ctx, other); + a_version *rhs = (a_version *)(*_env)->GetDirectBufferAddress(_env, _rhs); + return a_version_cmp(ctx, rhs); } JNIEXPORT jint JNICALL Java_liba_version_check(JNIEnv *_env, jclass _cls, jint major, jint minor, jint patch) diff --git a/javascript/liba.d.ts b/javascript/liba.d.ts index 90884b2..7a7969c 100644 --- a/javascript/liba.d.ts +++ b/javascript/liba.d.ts @@ -957,38 +957,38 @@ declare namespace liba { */ parse(ver: string): version; /** - * compare this version with other versions - * @param ver other version to be compared + * compare this version with that version + * @param ver version to be compared */ cmp(ver: version): number; /** - * this version is less than other version - * @param ver other version to be compared + * this version is less than that version + * @param ver version to be compared */ lt(ver: version): boolean; /** - * this version is greater than other version - * @param ver other version to be compared + * this version is greater than that version + * @param ver version to be compared */ gt(ver: version): boolean; /** - * this version is less than or equal to other version - * @param ver other version to be compared + * this version is less than or equal to that version + * @param ver version to be compared */ le(ver: version): boolean; /** - * this version is greater than or equal to other version - * @param ver other version to be compared + * this version is greater than or equal to that version + * @param ver version to be compared */ ge(ver: version): boolean; /** - * this version is equal to other version - * @param ver other version to be compared + * this version is equal to that version + * @param ver version to be compared */ eq(ver: version): boolean; /** - * this version is not equal to other version - * @param ver other version to be compared + * this version is not equal to that version + * @param ver version to be compared */ ne(ver: version): boolean; delete(): void; diff --git a/liba.pyi b/liba.pyi index 2d46321..393da72 100644 --- a/liba.pyi +++ b/liba.pyi @@ -618,13 +618,13 @@ class version: @staticmethod def check(major: int = 0, minor: int = 0, patch: int = 0) -> int: ... def __init__(self, major: int = 0, minor: int = 0, third: int = 0, extra: int = 0) -> None: ... - def compare(self, other: version) -> int: ... - def __lt__(self, other: version) -> bool: ... - def __gt__(self, other: version) -> bool: ... - def __le__(self, other: version) -> bool: ... - def __ge__(self, other: version) -> bool: ... - def __eq__(self, other: version) -> bool: ... - def __ne__(self, other: version) -> bool: ... + def compare(self, that: version) -> int: ... + def __lt__(self, that: version) -> bool: ... + def __gt__(self, that: version) -> bool: ... + def __le__(self, that: version) -> bool: ... + def __ge__(self, that: version) -> bool: ... + def __eq__(self, that: version) -> bool: ... + def __ne__(self, that: version) -> bool: ... def parse(self, ver: bytes) -> version: ... @property def major(self) -> int: ... diff --git a/lua/src/complex.h b/lua/src/complex.h index c538dc5..9611212 100644 --- a/lua/src/complex.h +++ b/lua/src/complex.h @@ -48,16 +48,16 @@ int liba_complex_rect(lua_State *L); int liba_complex_polar(lua_State *L); /*** - complex number self is equal to complex number other - @tparam a.complex other other complex number + complex number self is equal to complex number that + @tparam a.complex that complex number @treturn bool result of comparison @function eq */ int liba_complex_eq(lua_State *L); /*** - complex number self is not equal to complex number other - @tparam a.complex other other complex number + complex number self is not equal to complex number that + @tparam a.complex that complex number @treturn bool result of comparison @function ne */ diff --git a/lua/src/version.h b/lua/src/version.h index 650c6f1..ec4e3d9 100644 --- a/lua/src/version.h +++ b/lua/src/version.h @@ -51,58 +51,58 @@ int liba_version_init(lua_State *L); int liba_version_parse(lua_State *L); /*** - compare the version self with the version other - @tparam a.version other other version userdata - @treturn integer <0 version self < version other - @treturn integer >0 version self > version other - @treturn integer 0 version self == version other + compare the version self with the version that + @tparam a.version that version userdata + @treturn integer <0 version self < version that + @treturn integer >0 version self > version that + @treturn integer 0 version self == version that @function cmp */ int liba_version_cmp(lua_State *L); /*** - version self is less than version other - @tparam a.version other other version userdata + version self is less than version that + @tparam a.version that version userdata @treturn bool result of comparison @function lt */ int liba_version_lt(lua_State *L); /*** - version self is greater than version other - @tparam a.version other other version userdata + version self is greater than version that + @tparam a.version that version userdata @treturn bool result of comparison @function gt */ int liba_version_gt(lua_State *L); /*** - version self is less than or equal to version other - @tparam a.version other other version userdata + version self is less than or equal to version that + @tparam a.version that version userdata @treturn bool result of comparison @function le */ int liba_version_le(lua_State *L); /*** - version self is greater than or equal to version other - @tparam a.version other other version userdata + version self is greater than or equal to version that + @tparam a.version that version userdata @treturn bool result of comparison @function ge */ int liba_version_ge(lua_State *L); /*** - version self is equal to version other - @tparam a.version other other version userdata + version self is equal to version that + @tparam a.version that version userdata @treturn bool result of comparison @function eq */ int liba_version_eq(lua_State *L); /*** - version self is not equal to version other - @tparam a.version other other version userdata + version self is not equal to version that + @tparam a.version that version userdata @treturn bool result of comparison @function ne */ diff --git a/python/src/a/version.pxi b/python/src/a/version.pxi index 8555807..5781ebe 100644 --- a/python/src/a/version.pxi +++ b/python/src/a/version.pxi @@ -36,20 +36,20 @@ cdef class version: if self.ctx.extra == 0: return "%u.%u.%u" % (self.ctx.major, self.ctx.minor, self.ctx.third) return "%u.%u.%u.%u" % (self.ctx.major, self.ctx.minor, self.ctx.third, self.ctx.extra) - def compare(self, other: version): - return a_version_cmp(&self.ctx, &other.ctx) - def __lt__(self, other: version): - return a_version_lt(&self.ctx, &other.ctx) - def __gt__(self, other: version): - return a_version_gt(&self.ctx, &other.ctx) - def __le__(self, other: version): - return a_version_le(&self.ctx, &other.ctx) - def __ge__(self, other: version): - return a_version_ge(&self.ctx, &other.ctx) - def __eq__(self, other: version): - return a_version_eq(&self.ctx, &other.ctx) - def __ne__(self, other: version): - return a_version_ne(&self.ctx, &other.ctx) + def compare(self, that: version): + return a_version_cmp(&self.ctx, &that.ctx) + def __lt__(self, that: version): + return a_version_lt(&self.ctx, &that.ctx) + def __gt__(self, that: version): + return a_version_gt(&self.ctx, &that.ctx) + def __le__(self, that: version): + return a_version_le(&self.ctx, &that.ctx) + def __ge__(self, that: version): + return a_version_ge(&self.ctx, &that.ctx) + def __eq__(self, that: version): + return a_version_eq(&self.ctx, &that.ctx) + def __ne__(self, that: version): + return a_version_ne(&self.ctx, &that.ctx) def parse(self, ver: bytes): a_version_parse(&self.ctx, ver) return self diff --git a/quickjs/src/version.c b/quickjs/src/version.c index 3167dca..bf43b2f 100644 --- a/quickjs/src/version.c +++ b/quickjs/src/version.c @@ -117,9 +117,9 @@ static JSValue liba_version_cmp(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewInt32(ctx, a_version_cmp(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewInt32(ctx, a_version_cmp(self, that)); } static JSValue liba_version_lt(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -127,9 +127,9 @@ static JSValue liba_version_lt(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_lt(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_lt(self, that)); } static JSValue liba_version_gt(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -137,9 +137,9 @@ static JSValue liba_version_gt(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_gt(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_gt(self, that)); } static JSValue liba_version_le(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -147,9 +147,9 @@ static JSValue liba_version_le(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_le(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_le(self, that)); } static JSValue liba_version_ge(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -157,9 +157,9 @@ static JSValue liba_version_ge(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_ge(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_ge(self, that)); } static JSValue liba_version_eq(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -167,9 +167,9 @@ static JSValue liba_version_eq(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_eq(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_eq(self, that)); } static JSValue liba_version_ne(JSContext *ctx, JSValueConst this_val, int argc, JSValueConst *argv) @@ -177,9 +177,9 @@ static JSValue liba_version_ne(JSContext *ctx, JSValueConst this_val, int argc, (void)argc; a_version *const self = (a_version *)JS_GetOpaque2(ctx, this_val, liba_version_class_id); if (!self) { return JS_EXCEPTION; } - a_version *const other = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); - if (!other) { return JS_EXCEPTION; } - return JS_NewBool(ctx, a_version_ne(self, other)); + a_version *const that = (a_version *)JS_GetOpaque2(ctx, argv[0], liba_version_class_id); + if (!that) { return JS_EXCEPTION; } + return JS_NewBool(ctx, a_version_ne(self, that)); } static JSCFunctionListEntry const liba_version_proto[] = { diff --git a/src/lib.rs b/src/lib.rs index fd4f173..502dc41 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1837,8 +1837,8 @@ impl version { impl PartialOrd for version { #[inline(always)] - fn partial_cmp(&self, other: &version) -> Option { - let ok: int = unsafe { a_version_cmp(self, other) }; + fn partial_cmp(&self, that: &version) -> Option { + let ok: int = unsafe { a_version_cmp(self, that) }; if ok > 0 { return Some(core::cmp::Ordering::Greater); } @@ -1848,27 +1848,27 @@ impl PartialOrd for version { Some(core::cmp::Ordering::Equal) } #[inline(always)] - fn lt(&self, other: &version) -> bool { - unsafe { a_version_lt(self, other) } + fn lt(&self, that: &version) -> bool { + unsafe { a_version_lt(self, that) } } #[inline(always)] - fn gt(&self, other: &version) -> bool { - unsafe { a_version_gt(self, other) } + fn gt(&self, that: &version) -> bool { + unsafe { a_version_gt(self, that) } } #[inline(always)] - fn le(&self, other: &version) -> bool { - unsafe { a_version_le(self, other) } + fn le(&self, that: &version) -> bool { + unsafe { a_version_le(self, that) } } #[inline(always)] - fn ge(&self, other: &version) -> bool { - unsafe { a_version_ge(self, other) } + fn ge(&self, that: &version) -> bool { + unsafe { a_version_ge(self, that) } } } impl PartialEq for version { #[inline(always)] - fn eq(&self, other: &version) -> bool { - unsafe { a_version_eq(self, other) } + fn eq(&self, that: &version) -> bool { + unsafe { a_version_eq(self, that) } } } -- 2.11.4.GIT