mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-12-25 15:06:14 +01:00
Whitespace cleanups.
2008-01-21 Matthias Clasen <mclasen@redhat.com> * glocal*.c: * gvolumemanager.c: Whitespace cleanups. * glocalfileoutputsteam.c (_g_local_file_output_stream_create): Use the right mode when creating the file. svn path=/trunk/; revision=6341
This commit is contained in:
parent
5fbfef4cb7
commit
54300dde6d
@ -1,3 +1,11 @@
|
||||
2008-01-21 Matthias Clasen <mclasen@redhat.com>
|
||||
|
||||
* glocal*.c:
|
||||
* gvolumemanager.c: Whitespace cleanups.
|
||||
|
||||
* glocalfileoutputsteam.c (_g_local_file_output_stream_create):
|
||||
Use the right mode when creating the file.
|
||||
|
||||
2008-01-21 Murray Cumming,,, <murrayc@murrayc.com>
|
||||
|
||||
* gfileenumerator.c:
|
||||
|
@ -37,15 +37,16 @@ enum
|
||||
PROP_DIRNAME
|
||||
};
|
||||
|
||||
static gboolean g_local_directory_monitor_cancel (GFileMonitor* monitor);
|
||||
static void mounts_changed (GUnixMountMonitor *mount_monitor, gpointer user_data);
|
||||
static gboolean g_local_directory_monitor_cancel (GFileMonitor *monitor);
|
||||
static void mounts_changed (GUnixMountMonitor *mount_monitor,
|
||||
gpointer user_data);
|
||||
|
||||
G_DEFINE_ABSTRACT_TYPE (GLocalDirectoryMonitor, g_local_directory_monitor, G_TYPE_FILE_MONITOR)
|
||||
|
||||
static void
|
||||
g_local_directory_monitor_finalize (GObject* object)
|
||||
g_local_directory_monitor_finalize (GObject *object)
|
||||
{
|
||||
GLocalDirectoryMonitor* local_monitor;
|
||||
GLocalDirectoryMonitor *local_monitor;
|
||||
local_monitor = G_LOCAL_DIRECTORY_MONITOR (object);
|
||||
|
||||
g_free (local_monitor->dirname);
|
||||
@ -161,7 +162,7 @@ g_local_directory_monitor_class_init (GLocalDirectoryMonitorClass* klass)
|
||||
}
|
||||
|
||||
static void
|
||||
g_local_directory_monitor_init (GLocalDirectoryMonitor* local_monitor)
|
||||
g_local_directory_monitor_init (GLocalDirectoryMonitor *local_monitor)
|
||||
{
|
||||
}
|
||||
|
||||
@ -248,7 +249,7 @@ get_default_local_directory_monitor (gpointer data)
|
||||
|
||||
klass = G_LOCAL_DIRECTORY_MONITOR_CLASS (g_type_class_ref (monitor_impls[i]));
|
||||
|
||||
if (klass->is_supported())
|
||||
if (klass->is_supported ())
|
||||
{
|
||||
chosen_class = klass;
|
||||
break;
|
||||
@ -269,7 +270,7 @@ get_default_local_directory_monitor (gpointer data)
|
||||
}
|
||||
|
||||
/**
|
||||
* g_local_directory_monitor_new:
|
||||
* _g_local_directory_monitor_new:
|
||||
* @dirname: filename of the directory to monitor.
|
||||
* @flags: #GFileMonitorFlags.
|
||||
*
|
||||
@ -308,7 +309,7 @@ _g_local_directory_monitor_new (const char *dirname,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
g_local_directory_monitor_cancel (GFileMonitor* monitor)
|
||||
g_local_directory_monitor_cancel (GFileMonitor *monitor)
|
||||
{
|
||||
GLocalDirectoryMonitor *local_monitor = G_LOCAL_DIRECTORY_MONITOR (monitor);
|
||||
|
||||
|
@ -94,7 +94,7 @@
|
||||
|
||||
#include "gioalias.h"
|
||||
|
||||
static void g_local_file_file_iface_init (GFileIface *iface);
|
||||
static void g_local_file_file_iface_init (GFileIface *iface);
|
||||
|
||||
static GFileAttributeInfoList *local_writable_attributes = NULL;
|
||||
static GFileAttributeInfoList *local_writable_namespaces = NULL;
|
||||
@ -111,7 +111,7 @@ G_DEFINE_TYPE_WITH_CODE (GLocalFile, g_local_file, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_FILE,
|
||||
g_local_file_file_iface_init))
|
||||
|
||||
static char * find_mountpoint_for (const char *file, dev_t dev);
|
||||
static char *find_mountpoint_for (const char *file, dev_t dev);
|
||||
|
||||
static void
|
||||
g_local_file_finalize (GObject *object)
|
||||
@ -355,7 +355,7 @@ name_is_valid_for_display (const char *string,
|
||||
|
||||
while ((c = *string++) != 0)
|
||||
{
|
||||
if (g_ascii_iscntrl(c))
|
||||
if (g_ascii_iscntrl (c))
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -684,7 +684,7 @@ static gboolean
|
||||
device_equal (gconstpointer v1,
|
||||
gconstpointer v2)
|
||||
{
|
||||
return *(dev_t *)v1 == * (dev_t *)v2;
|
||||
return *(dev_t *)v1 == *(dev_t *)v2;
|
||||
}
|
||||
|
||||
static guint
|
||||
@ -936,7 +936,7 @@ g_local_file_set_display_name (GFile *file,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
new_file = g_file_get_child_for_display_name (parent, display_name, error);
|
||||
new_file = g_file_get_child_for_display_name (parent, display_name, error);
|
||||
g_object_unref (parent);
|
||||
|
||||
if (new_file == NULL)
|
||||
@ -1025,13 +1025,13 @@ g_local_file_query_writable_namespaces (GFile *file,
|
||||
}
|
||||
|
||||
static gboolean
|
||||
g_local_file_set_attribute (GFile *file,
|
||||
const char *attribute,
|
||||
GFileAttributeType type,
|
||||
gpointer value_p,
|
||||
GFileQueryInfoFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
g_local_file_set_attribute (GFile *file,
|
||||
const char *attribute,
|
||||
GFileAttributeType type,
|
||||
gpointer value_p,
|
||||
GFileQueryInfoFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GLocalFile *local = G_LOCAL_FILE (file);
|
||||
|
||||
@ -1053,7 +1053,7 @@ g_local_file_set_attributes_from_info (GFile *file,
|
||||
{
|
||||
GLocalFile *local = G_LOCAL_FILE (file);
|
||||
int res, chained_res;
|
||||
GFileIface* default_iface;
|
||||
GFileIface *default_iface;
|
||||
|
||||
res = _g_local_file_info_set_attributes (local->filename,
|
||||
info, flags,
|
||||
|
@ -546,7 +546,7 @@ get_one_xattr_from_fd (int fd,
|
||||
char *value_p;
|
||||
ssize_t len;
|
||||
|
||||
len = g_fgetxattr (fd, xattr, value, sizeof (value)-1);
|
||||
len = g_fgetxattr (fd, xattr, value, sizeof (value) - 1);
|
||||
|
||||
value_p = NULL;
|
||||
if (len >= 0)
|
||||
@ -558,7 +558,7 @@ get_one_xattr_from_fd (int fd,
|
||||
if (len < 0)
|
||||
return;
|
||||
|
||||
value_p = g_malloc (len+1);
|
||||
value_p = g_malloc (len + 1);
|
||||
|
||||
len = g_fgetxattr (fd, xattr, value_p, len);
|
||||
|
||||
@ -1072,11 +1072,11 @@ lookup_uid_data (uid_t uid)
|
||||
if (data->user_name != NULL)
|
||||
data->real_name = g_strdup (data->user_name);
|
||||
else
|
||||
data->real_name = g_strdup_printf("user #%d", (int)uid);
|
||||
data->real_name = g_strdup_printf ("user #%d", (int)uid);
|
||||
}
|
||||
|
||||
if (data->user_name == NULL)
|
||||
data->user_name = g_strdup_printf("%d", (int)uid);
|
||||
data->user_name = g_strdup_printf ("%d", (int)uid);
|
||||
|
||||
g_hash_table_replace (uid_cache, GINT_TO_POINTER (uid), data);
|
||||
|
||||
@ -1244,7 +1244,7 @@ get_thumbnail_attributes (const char *path,
|
||||
basename = g_strconcat (g_checksum_get_string (checksum), ".png", NULL);
|
||||
g_checksum_free (checksum);
|
||||
|
||||
filename = g_build_filename (g_get_home_dir(),
|
||||
filename = g_build_filename (g_get_home_dir (),
|
||||
".thumbnails", "normal", basename,
|
||||
NULL);
|
||||
|
||||
@ -1253,7 +1253,7 @@ get_thumbnail_attributes (const char *path,
|
||||
else
|
||||
{
|
||||
g_free (filename);
|
||||
filename = g_build_filename (g_get_home_dir(),
|
||||
filename = g_build_filename (g_get_home_dir (),
|
||||
".thumbnails", "fail",
|
||||
"gnome-thumbnail-factory",
|
||||
basename,
|
||||
@ -1268,10 +1268,10 @@ get_thumbnail_attributes (const char *path,
|
||||
|
||||
#ifdef G_OS_WIN32
|
||||
static void
|
||||
win32_get_file_user_info (const gchar* filename,
|
||||
gchar **group_name,
|
||||
gchar **user_name,
|
||||
gchar **real_name)
|
||||
win32_get_file_user_info (const gchar *filename,
|
||||
gchar **group_name,
|
||||
gchar **user_name,
|
||||
gchar **real_name)
|
||||
{
|
||||
PSECURITY_DESCRIPTOR psd = NULL;
|
||||
DWORD sd_size = 0; /* first call calculates the size required */
|
||||
@ -1308,8 +1308,8 @@ win32_get_file_user_info (const gchar* filename,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
name = g_try_malloc (name_len * sizeof (wchar_t));
|
||||
domain = g_try_malloc (domain_len * sizeof (wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
@ -1335,8 +1335,8 @@ win32_get_file_user_info (const gchar* filename,
|
||||
domain, &domain_len, /* no domain info yet */
|
||||
&name_use) && (ERROR_INSUFFICIENT_BUFFER != GetLastError()))
|
||||
break;
|
||||
name = g_try_malloc (name_len*sizeof(wchar_t));
|
||||
domain = g_try_malloc (domain_len*sizeof(wchar_t));
|
||||
name = g_try_malloc (name_len * sizeof (wchar_t));
|
||||
domain = g_try_malloc (domain_len * sizeof (wchar_t));
|
||||
if (name && domain &&
|
||||
LookupAccountSidW (NULL, /* local machine */
|
||||
psid,
|
||||
@ -1490,7 +1490,7 @@ _g_local_file_info_get (const char *basename,
|
||||
|
||||
mimetype_icon = g_strdup (content_type);
|
||||
|
||||
while ((p = strchr(mimetype_icon, '/')) != NULL)
|
||||
while ((p = strchr (mimetype_icon, '/')) != NULL)
|
||||
*p = '-';
|
||||
|
||||
p = strchr (content_type, '/');
|
||||
@ -1927,7 +1927,7 @@ set_mtime_atime (char *filename,
|
||||
times[1].tv_usec = val_usec;
|
||||
}
|
||||
|
||||
res = utimes(filename, times);
|
||||
res = utimes (filename, times);
|
||||
if (res == -1)
|
||||
{
|
||||
g_set_error (error, G_IO_ERROR,
|
||||
@ -1941,13 +1941,13 @@ set_mtime_atime (char *filename,
|
||||
#endif
|
||||
|
||||
gboolean
|
||||
_g_local_file_info_set_attribute (char *filename,
|
||||
const char *attribute,
|
||||
GFileAttributeType type,
|
||||
gpointer value_p,
|
||||
GFileQueryInfoFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
_g_local_file_info_set_attribute (char *filename,
|
||||
const char *attribute,
|
||||
GFileAttributeType type,
|
||||
gpointer value_p,
|
||||
GFileQueryInfoFlags flags,
|
||||
GCancellable *cancellable,
|
||||
GError **error)
|
||||
{
|
||||
GFileAttributeValue value = { 0 };
|
||||
|
||||
|
@ -256,8 +256,7 @@ g_local_file_input_stream_can_seek (GFileInputStream *stream)
|
||||
|
||||
pos = lseek (file->priv->fd, 0, SEEK_CUR);
|
||||
|
||||
if (pos == (off_t)-1 &&
|
||||
errno == ESPIPE)
|
||||
if (pos == (off_t)-1 && errno == ESPIPE)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
|
@ -110,8 +110,7 @@ g_local_file_monitor_finalize (GObject *object)
|
||||
(*G_OBJECT_CLASS (g_local_file_monitor_parent_class)->finalize) (object);
|
||||
}
|
||||
|
||||
static void
|
||||
g_local_file_monitor_class_init (GLocalFileMonitorClass* klass)
|
||||
static void g_local_file_monitor_class_init (GLocalFileMonitorClass *klass)
|
||||
{
|
||||
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
|
||||
|
||||
@ -177,7 +176,7 @@ get_default_local_file_monitor (gpointer data)
|
||||
|
||||
klass = G_LOCAL_FILE_MONITOR_CLASS (g_type_class_ref (monitor_impls[i]));
|
||||
|
||||
if (klass->is_supported())
|
||||
if (klass->is_supported ())
|
||||
{
|
||||
chosen_class = klass;
|
||||
break;
|
||||
|
@ -306,8 +306,7 @@ g_local_file_output_stream_can_seek (GFileOutputStream *stream)
|
||||
|
||||
pos = lseek (file->priv->fd, 0, SEEK_CUR);
|
||||
|
||||
if (pos == (off_t)-1 &&
|
||||
errno == ESPIPE)
|
||||
if (pos == (off_t)-1 && errno == ESPIPE)
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
@ -437,9 +436,7 @@ _g_local_file_output_stream_create (const char *filename,
|
||||
else
|
||||
mode = 0666;
|
||||
|
||||
fd = g_open (filename,
|
||||
O_CREAT | O_EXCL | O_WRONLY,
|
||||
0666);
|
||||
fd = g_open (filename, O_CREAT | O_EXCL | O_WRONLY, mode);
|
||||
if (fd == -1)
|
||||
{
|
||||
int errsv = errno;
|
||||
@ -480,9 +477,7 @@ _g_local_file_output_stream_append (const char *filename,
|
||||
else
|
||||
mode = 0666;
|
||||
|
||||
fd = g_open (filename,
|
||||
O_CREAT | O_APPEND | O_WRONLY,
|
||||
mode);
|
||||
fd = g_open (filename, O_CREAT | O_APPEND | O_WRONLY, mode);
|
||||
if (fd == -1)
|
||||
{
|
||||
int errsv = errno;
|
||||
@ -863,9 +858,7 @@ _g_local_file_output_stream_replace (const char *filename,
|
||||
mode = 0666;
|
||||
|
||||
/* If the file doesn't exist, create it */
|
||||
fd = g_open (filename,
|
||||
O_CREAT | O_EXCL | O_WRONLY,
|
||||
mode);
|
||||
fd = g_open (filename, O_CREAT | O_EXCL | O_WRONLY, mode);
|
||||
|
||||
if (fd == -1 && errno == EEXIST)
|
||||
{
|
||||
|
@ -134,7 +134,7 @@ g_local_vfs_parse_name (GVfs *vfs,
|
||||
user_end = parse_name;
|
||||
|
||||
if (user_end == user_start)
|
||||
user_prefix = g_strdup (g_get_home_dir());
|
||||
user_prefix = g_strdup (g_get_home_dir ());
|
||||
else
|
||||
{
|
||||
#ifdef HAVE_PWD_H
|
||||
|
@ -312,8 +312,8 @@ g_volume_monitor_get_mounts (GVolumeMonitor *volume_monitor)
|
||||
* Returns: a #GVolume or %NULL if no such volume is available.
|
||||
**/
|
||||
GVolume *
|
||||
g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
|
||||
const char *uuid)
|
||||
g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
|
||||
const char *uuid)
|
||||
{
|
||||
GVolumeMonitorClass *class;
|
||||
|
||||
@ -335,8 +335,8 @@ g_volume_monitor_get_volume_for_uuid (GVolumeMonitor *volume_monitor,
|
||||
* Returns: a #GMount or %NULL if no such mount is available.
|
||||
**/
|
||||
GMount *
|
||||
g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
|
||||
const char *uuid)
|
||||
g_volume_monitor_get_mount_for_uuid (GVolumeMonitor *volume_monitor,
|
||||
const char *uuid)
|
||||
{
|
||||
GVolumeMonitorClass *class;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user