Skip to content

Commit 147b960

Browse files
committed
refactor: delete buffer_t
1 parent 35aa3f4 commit 147b960

File tree

8 files changed

+19
-343
lines changed

8 files changed

+19
-343
lines changed

CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,6 @@ set(AWE_SRCS
7070
${BUILD_DIR}/xrdb.c
7171
${BUILD_DIR}/common/atoms.c
7272
${BUILD_DIR}/common/backtrace.c
73-
${BUILD_DIR}/common/buffer.c
7473
${BUILD_DIR}/common/luaclass.c
7574
${BUILD_DIR}/common/lualib.c
7675
${BUILD_DIR}/common/luaobject.c

awesome.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,7 @@ main(int argc, char **argv)
585585
globalconf.mousegrabber = LUA_REFNIL;
586586
globalconf.exit_code = EXIT_SUCCESS;
587587
globalconf.api_level = awesome_default_api_level();
588-
buffer_init(&globalconf.startup_errors);
588+
globalconf.startup_errors = g_string_new(NULL);
589589
string_array_init(&searchpath);
590590

591591
/* save argv */

common/buffer.c

Lines changed: 0 additions & 121 deletions
This file was deleted.

common/buffer.h

Lines changed: 0 additions & 199 deletions
This file was deleted.

ewmh.c

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -305,20 +305,18 @@ ewmh_update_net_current_desktop(lua_State *L)
305305
void
306306
ewmh_update_net_desktop_names(void)
307307
{
308-
buffer_t buf;
309-
310-
buffer_inita(&buf, BUFSIZ);
308+
GString* buf = g_string_new(NULL);
311309

312310
foreach(tag, globalconf.tags)
313311
{
314-
buffer_adds(&buf, tag_get_name(*tag));
315-
buffer_addc(&buf, '\0');
312+
g_string_append(buf,tag_get_name(*tag));
313+
g_string_append_c(buf, '\0');
316314
}
317315

318316
xcb_change_property(globalconf.connection, XCB_PROP_MODE_REPLACE,
319317
globalconf.screen->root,
320-
_NET_DESKTOP_NAMES, UTF8_STRING, 8, buf.len, buf.s);
321-
buffer_wipe(&buf);
318+
_NET_DESKTOP_NAMES, UTF8_STRING, 8, buf->len, buf->str);
319+
g_string_free(buf, TRUE);
322320
}
323321

324322
static void

globalconf.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141
#include "objects/key.h"
4242
#include "common/xembed.h"
4343
#include "common/xcursor.h"
44-
#include "common/buffer.h"
4544

4645
#define ROOT_WINDOW_EVENT_MASK \
4746
(const uint32_t []) { \
@@ -148,7 +147,7 @@ typedef struct
148147
lua_State *real_L_dont_use_directly;
149148
} L;
150149
/** All errors messages from loading config files */
151-
buffer_t startup_errors;
150+
GString* startup_errors;
152151
/** main loop that awesome is running on */
153152
GMainLoop *loop;
154153
/** The key grabber function */

0 commit comments

Comments
 (0)