Fix a lot of clang complaints

Mostly dead assignments.
This commit is contained in:
Matthias Clasen 2009-09-09 00:18:23 -04:00
parent 04d632ccf5
commit 53fc10d269
13 changed files with 35 additions and 84 deletions

View File

@ -474,12 +474,10 @@ g_buffered_output_stream_flush (GOutputStream *stream,
GError **error)
{
GBufferedOutputStream *bstream;
GBufferedOutputStreamPrivate *priv;
GOutputStream *base_stream;
gboolean res;
bstream = G_BUFFERED_OUTPUT_STREAM (stream);
priv = bstream->priv;
base_stream = G_FILTER_OUTPUT_STREAM (stream)->base_stream;
res = flush_buffer (bstream, cancellable, error);
@ -498,14 +496,11 @@ g_buffered_output_stream_close (GOutputStream *stream,
GError **error)
{
GBufferedOutputStream *bstream;
GBufferedOutputStreamPrivate *priv;
GOutputStream *base_stream;
gboolean res;
bstream = G_BUFFERED_OUTPUT_STREAM (stream);
priv = bstream->priv;
base_stream = G_FILTER_OUTPUT_STREAM (bstream)->base_stream;
res = flush_buffer (bstream, cancellable, error);
if (g_filter_output_stream_get_close_base_stream (G_FILTER_OUTPUT_STREAM (stream)))

View File

@ -815,20 +815,15 @@ scan_for_chars (GDataInputStream *stream,
const char *stop_chars)
{
GBufferedInputStream *bstream;
GDataInputStreamPrivate *priv;
const char *buffer;
gsize start, end, peeked;
int i;
gssize found_pos;
gsize available, checked;
const char *stop_char;
priv = stream->priv;
bstream = G_BUFFERED_INPUT_STREAM (stream);
checked = *checked_out;
found_pos = -1;
start = checked;
buffer = (const char *)g_buffered_input_stream_peek_buffer (bstream, &available) + start;

View File

@ -695,11 +695,8 @@ g_string_append_encoded (GString *string,
const char *reserved_chars_allowed)
{
unsigned char c;
const char *end;
static const gchar hex[16] = "0123456789ABCDEF";
end = encoded + strlen (encoded);
while ((c = *encoded) != 0)
{
if (is_valid (c, reserved_chars_allowed))

View File

@ -91,10 +91,6 @@ static gboolean g_input_stream_real_close_finish (GInputStream *stream,
static void
g_input_stream_finalize (GObject *object)
{
GInputStream *stream;
stream = G_INPUT_STREAM (object);
G_OBJECT_CLASS (g_input_stream_parent_class)->finalize (object);
}
@ -352,8 +348,6 @@ g_input_stream_real_skip (GInputStream *stream,
char buffer[8192];
GError *my_error;
class = G_INPUT_STREAM_GET_CLASS (stream);
if (G_IS_SEEKABLE (stream) && g_seekable_can_seek (G_SEEKABLE (stream)))
{
if (g_seekable_seek (G_SEEKABLE (stream),

View File

@ -97,10 +97,6 @@ static gboolean g_io_stream_real_close_finish (GIOStream *stream,
static void
g_io_stream_finalize (GObject *object)
{
GIOStream *stream;
stream = G_IO_STREAM (object);
G_OBJECT_CLASS (g_io_stream_parent_class)->finalize (object);
}

View File

@ -1721,7 +1721,6 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
char uid_str[32];
struct stat global_stat, trash_stat;
gboolean res;
int statres;
if (g_once_init_enter (&home_dev_set))
{
@ -1741,7 +1740,6 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
return FALSE;
globaldir = g_build_filename (topdir, ".Trash", NULL);
statres = g_lstat (globaldir, &global_stat);
if (g_lstat (globaldir, &global_stat) == 0 &&
S_ISDIR (global_stat.st_mode) &&
(global_stat.st_mode & S_ISVTX) != 0)
@ -1769,15 +1767,13 @@ _g_local_file_has_trash_dir (const char *dirname, dev_t dir_dev)
{
g_free (topdir);
g_free (trashdir);
return
S_ISDIR (trash_stat.st_mode) &&
return S_ISDIR (trash_stat.st_mode) &&
trash_stat.st_uid == uid;
}
g_free (trashdir);
/* User specific trash didn't exist, can we create it? */
res = g_access (topdir, W_OK) == 0;
g_free (topdir);
return res;

View File

@ -79,10 +79,6 @@ static GFileInfo *g_local_file_input_stream_query_info (GFileInputStream *strea
static void
g_local_file_input_stream_finalize (GObject *object)
{
GLocalFileInputStream *file;
file = G_LOCAL_FILE_INPUT_STREAM (object);
G_OBJECT_CLASS (g_local_file_input_stream_parent_class)->finalize (object);
}

View File

@ -99,10 +99,6 @@ static gboolean g_output_stream_real_close_finish (GOutputStream *s
static void
g_output_stream_finalize (GObject *object)
{
GOutputStream *stream;
stream = G_OUTPUT_STREAM (object);
G_OBJECT_CLASS (g_output_stream_parent_class)->finalize (object);
}
@ -350,7 +346,8 @@ g_output_stream_flush (GOutputStream *stream,
*
* Splices an input stream into an output stream.
*
* Returns: a #gssize containing the size of the data spliced.
* Returns: a #gssize containing the size of the data spliced, or
* -1 if an error occurred.
**/
gssize
g_output_stream_splice (GOutputStream *stream,
@ -360,7 +357,7 @@ g_output_stream_splice (GOutputStream *stream,
GError **error)
{
GOutputStreamClass *class;
gboolean res;
gssize bytes_copied;
g_return_val_if_fail (G_IS_OUTPUT_STREAM (stream), -1);
g_return_val_if_fail (G_IS_INPUT_STREAM (source), -1);
@ -377,18 +374,17 @@ g_output_stream_splice (GOutputStream *stream,
class = G_OUTPUT_STREAM_GET_CLASS (stream);
res = TRUE;
if (cancellable)
g_cancellable_push_current (cancellable);
res = class->splice (stream, source, flags, cancellable, error);
bytes_copied = class->splice (stream, source, flags, cancellable, error);
if (cancellable)
g_cancellable_pop_current (cancellable);
g_output_stream_clear_pending (stream);
return res;
return bytes_copied;
}
static gssize

View File

@ -116,10 +116,6 @@ static gboolean g_unix_input_stream_close_finish (GInputStream *stream,
static void
g_unix_input_stream_finalize (GObject *object)
{
GUnixInputStream *stream;
stream = G_UNIX_INPUT_STREAM (object);
G_OBJECT_CLASS (g_unix_input_stream_parent_class)->finalize (object);
}

View File

@ -108,10 +108,6 @@ static gboolean g_unix_output_stream_close_finish (GOutputStream *stream,
static void
g_unix_output_stream_finalize (GObject *object)
{
GUnixOutputStream *stream;
stream = G_UNIX_OUTPUT_STREAM (object);
G_OBJECT_CLASS (g_unix_output_stream_parent_class)->finalize (object);
}

View File

@ -1418,8 +1418,7 @@ g_build_path_va (const gchar *separator,
if (separator_len)
{
while (start &&
strncmp (start, separator, separator_len) == 0)
while (strncmp (start, separator, separator_len) == 0)
start += separator_len;
}

View File

@ -413,7 +413,6 @@ g_key_file_load_from_fd (GKeyFile *key_file,
}
key_file->flags = flags;
bytes_read = 0;
do
{
bytes_read = read (fd, read_buf, 4096);

View File

@ -498,7 +498,6 @@ gboolean
g_match_info_next (GMatchInfo *match_info,
GError **error)
{
gint opts;
gint prev_match_start;
gint prev_match_end;
@ -506,8 +505,6 @@ g_match_info_next (GMatchInfo *match_info,
g_return_val_if_fail (error == NULL || *error == NULL, FALSE);
g_return_val_if_fail (match_info->pos >= 0, FALSE);
opts = match_info->regex->match_opts | match_info->match_opts;
prev_match_start = match_info->offsets[0];
prev_match_end = match_info->offsets[1];
@ -516,8 +513,7 @@ g_match_info_next (GMatchInfo *match_info,
match_info->string,
match_info->string_len,
match_info->pos,
match_info->regex->match_opts |
match_info->match_opts,
match_info->regex->match_opts | match_info->match_opts,
match_info->offsets,
match_info->n_offsets);
if (IS_PCRE_ERROR (match_info->matches))