Switch to libgsystem local allocation macros

And drop our compatibility wrapper.
This commit is contained in:
Colin Walters committed 2013-07-07 12:27:44 -04:00
1 parent bb6eedfb25
commit 4b170d656c
42 files changed
+480 -521

No files matched your search

+1 -1
View File
@@ -112,7 +112,7 @@ ot_gio_splice_get_checksum (GOutputStream *out,
{
gboolean ret = FALSE;
GChecksum *checksum = NULL;
ot_lfree guchar *ret_csum = NULL;
gs_free guchar *ret_csum = NULL;
checksum = g_checksum_new (G_CHECKSUM_SHA256);
+4 -4
View File
@@ -55,8 +55,8 @@ ot_gfile_from_build_path (const char *first, ...)
{
va_list args;
const char *arg;
ot_lfree char *path = NULL;
ot_lptrarray GPtrArray *components = NULL;
gs_free char *path = NULL;
gs_unref_ptrarray GPtrArray *components = NULL;
va_start (args, first);
@@ -110,8 +110,8 @@ ot_gfile_get_child_build_path (GFile *parent,
{
va_list args;
const char *arg;
ot_lfree char *path = NULL;
ot_lptrarray GPtrArray *components = NULL;
gs_free char *path = NULL;
gs_unref_ptrarray GPtrArray *components = NULL;
va_start (args, first);
+1 -1
View File
@@ -69,7 +69,7 @@ ot_keyfile_get_value_with_default (GKeyFile *keyfile,
{
gboolean ret = FALSE;
GError *temp_error = NULL;
ot_lfree char *ret_value;
gs_free char *ret_value;
ret_value = g_key_file_get_value (keyfile, section, value, &temp_error);
if (temp_error)
-39
View File
@@ -1,39 +0,0 @@
/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
*
* Copyright (C) 2011 Colin Walters <walters@verbum.org>.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
* Author: Colin Walters <walters@verbum.org>
*/
#ifndef __OSTREE_LOCAL_ALLOC_H__
#define __OSTREE_LOCAL_ALLOC_H__
#include <gio/gio.h>
#include "libgsystem.h"
G_BEGIN_DECLS
#define ot_lfree __attribute__ ((cleanup(gs_local_free)))
#define ot_lobj __attribute__ ((cleanup(gs_local_obj_unref)))
#define ot_lvariant __attribute__ ((cleanup(gs_local_variant_unref)))
#define ot_lptrarray __attribute__ ((cleanup(gs_local_ptrarray_unref)))
#define ot_lhash __attribute__ ((cleanup(gs_local_hashtable_unref)))
G_END_DECLS
#endif
+2 -2
View File
@@ -47,7 +47,7 @@ ot_util_spawn_pager (GOutputStream **out_stream,
char *argv[2];
int stdin_fd;
pid_t pid;
ot_lfree GOutputStream *ret_stream = NULL;
gs_free GOutputStream *ret_stream = NULL;
if (!isatty (1))
{
@@ -134,7 +134,7 @@ ot_util_path_split_validate (const char *path,
{
gboolean ret = FALSE;
int i;
ot_lptrarray GPtrArray *ret_components = NULL;
gs_unref_ptrarray GPtrArray *ret_components = NULL;
if (strlen (path) > PATH_MAX)
{
+4 -4
View File
@@ -66,7 +66,7 @@ ot_util_variant_save (GFile *dest,
GError **error)
{
gboolean ret = FALSE;
ot_lobj GOutputStream *out = NULL;
gs_unref_object GOutputStream *out = NULL;
gsize bytes_written;
out = (GOutputStream*)g_file_replace (dest, NULL, FALSE, G_FILE_CREATE_REPLACE_DESTINATION,
@@ -109,7 +109,7 @@ ot_util_variant_map (GFile *src,
GError **error)
{
gboolean ret = FALSE;
ot_lvariant GVariant *ret_variant = NULL;
gs_unref_variant GVariant *ret_variant = NULL;
GMappedFile *mfile = NULL;
mfile = gs_file_map_noatime (src, NULL, error);
@@ -148,8 +148,8 @@ ot_util_variant_from_stream (GInputStream *src,
GError **error)
{
gboolean ret = FALSE;
ot_lobj GMemoryOutputStream *data_stream = NULL;
ot_lvariant GVariant *ret_variant = NULL;
gs_unref_object GMemoryOutputStream *data_stream = NULL;
gs_unref_variant GVariant *ret_variant = NULL;
data_stream = (GMemoryOutputStream*)g_memory_output_stream_new (NULL, 0, g_realloc, g_free);
-1
View File
@@ -38,7 +38,6 @@
} G_STMT_END;
#include <ot-waitable-queue.h>
#include <ot-local-alloc.h>
#include <ot-keyfile-utils.h>
#include <ot-gio-utils.h>
#include <ot-opt-utils.h>