Skip to content

Commit 54a75bd

Browse files
committed
Fix. Unify tostring methods
1 parent 56b4d05 commit 54a75bd

File tree

4 files changed

+13
-7
lines changed

4 files changed

+13
-7
lines changed

src/lceasy.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,13 +93,13 @@ int lcurl_easy_create(lua_State *L, int error_mode){
9393

9494
lcurl_easy_t *lcurl_geteasy_at(lua_State *L, int i){
9595
lcurl_easy_t *p = (lcurl_easy_t *)lutil_checkudatap (L, i, LCURL_EASY);
96-
luaL_argcheck (L, p != NULL, 1, LCURL_EASY_NAME" expected");
96+
luaL_argcheck (L, p != NULL, 1, LCURL_EASY_NAME" object expected");
9797
return p;
9898
}
9999

100100
static int lcurl_easy_to_s(lua_State *L){
101101
lcurl_easy_t *p = (lcurl_easy_t *)lutil_checkudatap (L, 1, LCURL_EASY);
102-
lua_pushfstring(L, LCURL_PREFIX " Easy (%p)", (void*)p);
102+
lua_pushfstring(L, LCURL_EASY_NAME" (%p)", (void*)p);
103103
return 1;
104104
}
105105

src/lchttppost.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,16 @@ int lcurl_hpost_create(lua_State *L, int error_mode){
112112

113113
lcurl_hpost_t *lcurl_gethpost_at(lua_State *L, int i){
114114
lcurl_hpost_t *p = (lcurl_hpost_t *)lutil_checkudatap (L, i, LCURL_HTTPPOST);
115-
luaL_argcheck (L, p != NULL, 1, LCURL_PREFIX"HTTPPost object expected");
115+
luaL_argcheck (L, p != NULL, 1, LCURL_HTTPPOST_NAME" object expected");
116116
return p;
117117
}
118118

119+
static int lcurl_hpost_to_s(lua_State *L){
120+
lcurl_hpost_t *p = (lcurl_hpost_t *)lutil_checkudatap (L, 1, LCURL_HTTPPOST);
121+
lua_pushfstring(L, LCURL_HTTPPOST_NAME" (%p)", (void*)p);
122+
return 1;
123+
}
124+
119125
static int lcurl_hpost_add_content(lua_State *L){
120126
// add_buffer(name, data, [type,] [headers])
121127
lcurl_hpost_t *p = lcurl_gethpost(L);

src/lcmulti.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,13 @@ int lcurl_multi_create(lua_State *L, int error_mode){
7171

7272
lcurl_multi_t *lcurl_getmulti_at(lua_State *L, int i){
7373
lcurl_multi_t *p = (lcurl_multi_t *)lutil_checkudatap (L, i, LCURL_MULTI);
74-
luaL_argcheck (L, p != NULL, 1, LCURL_MULTI_NAME" expected");
74+
luaL_argcheck (L, p != NULL, 1, LCURL_MULTI_NAME" object expected");
7575
return p;
7676
}
7777

7878
static int lcurl_multi_to_s(lua_State *L){
7979
lcurl_multi_t *p = (lcurl_multi_t *)lutil_checkudatap (L, 1, LCURL_MULTI);
80-
lua_pushfstring(L, LCURL_PREFIX " Multi (%p)", (void*)p);
80+
lua_pushfstring(L, LCURL_MULTI_NAME" (%p)", (void*)p);
8181
return 1;
8282
}
8383

src/lcshare.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,13 @@ int lcurl_share_create(lua_State *L, int error_mode){
3939

4040
lcurl_share_t *lcurl_getshare_at(lua_State *L, int i){
4141
lcurl_share_t *p = (lcurl_share_t *)lutil_checkudatap (L, i, LCURL_SHARE);
42-
luaL_argcheck (L, p != NULL, 1, LCURL_SHARE_NAME" expected");
42+
luaL_argcheck (L, p != NULL, 1, LCURL_SHARE_NAME" object expected");
4343
return p;
4444
}
4545

4646
static int lcurl_easy_to_s(lua_State *L){
4747
lcurl_share_t *p = (lcurl_share_t *)lutil_checkudatap (L, 1, LCURL_SHARE);
48-
lua_pushfstring(L, LCURL_PREFIX " Share (%p)", (void*)p);
48+
lua_pushfstring(L, LCURL_SHARE_NAME" (%p)", (void*)p);
4949
return 1;
5050
}
5151

0 commit comments

Comments
 (0)