summaryrefslogtreecommitdiff
path: root/src/plugins/ruby
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2015-02-21 09:16:25 +0100
committerSébastien Helleu <flashcode@flashtux.org>2015-02-21 09:16:25 +0100
commitc1a5a76d087d716e5f49afeb88352d3a126614af (patch)
tree85cb4c5ef5dfbd1465b5ca0f4340b0ddfb387b5c /src/plugins/ruby
parent8f11de68631bc707e818da8eb15845efbcb162f4 (diff)
downloadweechat-c1a5a76d087d716e5f49afeb88352d3a126614af.zip
scripts: reformat some code to make it more readable
Diffstat (limited to 'src/plugins/ruby')
-rw-r--r--src/plugins/ruby/weechat-ruby.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/ruby/weechat-ruby.c b/src/plugins/ruby/weechat-ruby.c
index 19b63fc8d..11c0fe9e7 100644
--- a/src/plugins/ruby/weechat-ruby.c
+++ b/src/plugins/ruby/weechat-ruby.c
@@ -164,6 +164,7 @@ weechat_ruby_hash_foreach_cb (VALUE key, VALUE value, void *arg)
const char *type_values;
hashtable = (struct t_hashtable *)arg;
+
if ((TYPE(key) == T_STRING) && (TYPE(value) == T_STRING))
{
type_values = weechat_hashtable_get_string (hashtable, "type_values");
@@ -175,11 +176,13 @@ weechat_ruby_hash_foreach_cb (VALUE key, VALUE value, void *arg)
else if (strcmp (type_values, WEECHAT_HASHTABLE_POINTER) == 0)
{
weechat_hashtable_set (hashtable, StringValuePtr(key),
- plugin_script_str2ptr (weechat_ruby_plugin,
- NULL, NULL,
- StringValuePtr(value)));
+ plugin_script_str2ptr (
+ weechat_ruby_plugin,
+ NULL, NULL,
+ StringValuePtr(value)));
}
}
+
return 0;
}
@@ -195,11 +198,8 @@ weechat_ruby_hash_to_hashtable (VALUE hash, int size, const char *type_keys,
{
struct t_hashtable *hashtable;
- hashtable = weechat_hashtable_new (size,
- type_keys,
- type_values,
- NULL,
- NULL);
+ hashtable = weechat_hashtable_new (size, type_keys, type_values,
+ NULL, NULL);
if (!hashtable)
return NULL;