aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJohannes Löthberg <johannes@kyriasis.com>2014-11-11 00:37:11 +0100
committerJohannes Löthberg <johannes@kyriasis.com>2014-11-11 00:37:11 +0100
commitd2ba67e68b6a7e262be4fac31fecf3977494c4a4 (patch)
tree2fc16f5640bd8281fbf412124f9a82ac351a3009 /src
parenta856598c95e5820e855f2483a49db5aa5e97176f (diff)
downloadyawa-d2ba67e68b6a7e262be4fac31fecf3977494c4a4.tar.xz
use ‘signed’ instead of ‘int’, redo prototypes
The flip arguments are implemented so delete comment
Diffstat (limited to 'src')
-rw-r--r--src/utils.c4
-rw-r--r--src/utils.h13
-rw-r--r--src/yawa.c13
-rw-r--r--src/yawa.h22
4 files changed, 33 insertions, 19 deletions
diff --git a/src/utils.c b/src/utils.c
index 0441ba2..55de956 100644
--- a/src/utils.c
+++ b/src/utils.c
@@ -9,7 +9,7 @@
#include "yawa.h"
#include "utils.h"
-int
+signed
parse_int(char *string, char *arg)
{
errno = 0;
@@ -33,7 +33,7 @@ parse_int(char *string, char *arg)
return (int)val;
}
-unsigned int
+unsigned
parse_uint(char *string, char *arg)
{
errno = 0;
diff --git a/src/utils.h b/src/utils.h
index ae9612e..50703b0 100644
--- a/src/utils.h
+++ b/src/utils.h
@@ -2,8 +2,15 @@
#define UTILS_H
#include <stdbool.h>
-int parse_int(char *string, char *arg);
-unsigned int parse_uint(char *string, char *arg);
-bool parse_color(char *arg, Color *c, int a);
+/// Prototypes
+
+signed
+parse_int(char *string, char *arg);
+
+unsigned
+parse_uint(char *string, char *arg);
+
+bool
+parse_color(char *arg, Color *c, int a);
#endif
diff --git a/src/yawa.c b/src/yawa.c
index dce73d7..971cd34 100644
--- a/src/yawa.c
+++ b/src/yawa.c
@@ -32,7 +32,7 @@
#include "utils.h"
#include "config.h"
-/* Order of parameters: KEY, ARG, STATE. */
+// Order of parameters: KEY, ARG, STATE.
static error_t
parse_opt(int key, char *arg, struct argp_state *state)
{
@@ -146,15 +146,14 @@ static char doc[] = "yawa -- Yet Another Wallpaper Application";
const char *argp_program_version = PACKAGE_STRING;
const char *argp_program_bug_address = "<" PACKAGE_BUGREPORT ">";
-/* The ARGP structure itself. */
+// The ARGP structure itself.
static struct argp argp = {options, parse_opt, "", doc, NULL, NULL, 0};
// Globals:
static Display *display;
static int screen;
-// Adapted from fluxbox' bsetroot
-int
+signed
set_root_atoms(Pixmap pixmap)
{
Atom atom_root, atom_eroot, type;
@@ -203,7 +202,7 @@ set_root_atoms(Pixmap pixmap)
return 1;
}
-int
+signed
load_image(ImageMode mode, const char *arg, int rootW, int rootH,
int alpha, Imlib_Image rootimg)
{
@@ -281,7 +280,7 @@ load_image(ImageMode mode, const char *arg, int rootW, int rootH,
return 1;
}
-int
+signed
main(int argc, char **argv)
{
struct arguments arguments = {
@@ -292,7 +291,7 @@ main(int argc, char **argv)
false,
};
- /* Where the magic happens */
+ // Where the magic happens
argp_parse(&argp, argc, argv, 0, 0, &arguments);
Visual *vis;
diff --git a/src/yawa.h b/src/yawa.h
index 60d3ee8..0e5abb3 100644
--- a/src/yawa.h
+++ b/src/yawa.h
@@ -15,9 +15,17 @@ typedef enum
Full, Fill, Center, Tile
} ImageMode;
-int set_root_atoms(Pixmap pixmap);
-int load_image(ImageMode mode, const char *arg, int rootW, int rootH, int alpha,
- Imlib_Image rootimg);
+/// Prototypes
+
+signed
+set_root_atoms(Pixmap pixmap);
+
+signed
+load_image(ImageMode mode, const char *arg, int rootW, int rootH,
+ int alpha, Imlib_Image rootimg);
+
+
+/// Argument parsing
static int num_add_colors;
struct arguments {
@@ -57,7 +65,7 @@ struct arguments {
bool write;
};
-/* Order of fields: {NAME, KEY, ARG, FLAGS, DOC, GROUP}. */
+// Order of fields: {NAME, KEY, ARG, FLAGS, DOC, GROUP}.
static struct argp_option options[] =
{
{0, 0, 0, 0, "Gradients:", 1},
@@ -82,9 +90,9 @@ static struct argp_option options[] =
{"contrast", 'o', "AMOUNT", 0, "Adjust the contrast of the current image", 4}, // Not implemented
{"brightness", 'B', "AMOUNT", 0, "Adjust the bightness of the current image", 4}, // Not implemented
{"gamma", 'G', "AMOUNT", 0, "Adjust the gamma level of the current image", 4}, // Not implemented
- {"flipv", 'v', 0, 0, "Flip the current image vertically", 4}, // Not implemented
- {"fliph", 'h', 0, 0, "Flip the current image horizontally", 4}, // Not implemented
- {"flipd", 'd', 0, 0, "Flip the current image diagonally", 4}, // Not implemented
+ {"flipv", 'v', 0, 0, "Flip the current image vertically", 4},
+ {"fliph", 'h', 0, 0, "Flip the current image horizontally", 4},
+ {"flipd", 'd', 0, 0, "Flip the current image diagonally", 4},
{0, 0, 0, 0, "Misc:", -1},
{"alpha", 'A', "AMOUNT", 0, "Adjust alpha level for colors and images", -1},