commit abedf819e72552fc1412a08e64088e778f55d890
parent fe818a462da13e7fec1bbd0af0a6c3dbcba40662
Author: Frederic Cambus <fred@statdns.com>
Date: Sun, 18 Nov 2018 12:28:21 +0100
Formatting fixes for functions
Diffstat:
14 files changed, 32 insertions(+), 15 deletions(-)
diff --git a/src/clean.c b/src/clean.c
@@ -17,7 +17,8 @@
#include "gd.h"
int
-ansilove_clean(struct ansilove_ctx *ctx) {
+ansilove_clean(struct ansilove_ctx *ctx)
+{
if (ctx == NULL)
return -1;
diff --git a/src/drawchar.c b/src/drawchar.c
@@ -15,9 +15,11 @@
#include "drawchar.h"
-void drawchar(gdImagePtr im, const uint8_t *font_data, uint32_t bits,
+void
+drawchar(gdImagePtr im, const uint8_t *font_data, uint32_t bits,
uint32_t height, uint32_t column, uint32_t row,
- uint32_t background, uint32_t foreground, uint8_t character) {
+ uint32_t background, uint32_t foreground, uint8_t character)
+{
uint32_t x, y;
gdImageFilledRectangle(im, column * bits, row*height, column * bits +
diff --git a/src/error.c b/src/error.c
@@ -14,7 +14,8 @@
#include "ansilove.h"
char *
-ansilove_error(struct ansilove_ctx *ctx) {
+ansilove_error(struct ansilove_ctx *ctx)
+{
if (ctx == NULL)
return NULL;
diff --git a/src/fonts.c b/src/fonts.c
@@ -38,7 +38,9 @@
#include "fonts/font_amiga_topaz_500.h"
#include "fonts/font_amiga_topaz_500_plus.h"
-void alSelectFont(struct fontStruct *fontData, int font) {
+void
+alSelectFont(struct fontStruct *fontData, int font)
+{
switch (font) {
case ANSILOVE_FONT_CP437_80x50:
fontData->font_data = font_pc_80x50;
diff --git a/src/init.c b/src/init.c
@@ -16,7 +16,8 @@
#include "ansilove.h"
int
-ansilove_init(struct ansilove_ctx *ctx, struct ansilove_options *options) {
+ansilove_init(struct ansilove_ctx *ctx, struct ansilove_options *options)
+{
if (ctx == NULL || options == NULL) {
if (ctx)
ctx->error = ANSILOVE_INVALID_PARAM;
diff --git a/src/loaders/artworx.c b/src/loaders/artworx.c
@@ -19,7 +19,8 @@
#define ADF_HEADER_LENGTH 4289 /* 192 + 4096 + 1 */
-int ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_artworx(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loaders/binary.c b/src/loaders/binary.c
@@ -19,7 +19,8 @@
#include "fonts.h"
#include "output.h"
-int ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_binary(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loaders/icedraw.c b/src/loaders/icedraw.c
@@ -20,7 +20,8 @@
#define IDF_HEADER_LENGTH 4144 /* 4096 + 48 */
-int ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_icedraw(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loaders/pcboard.c b/src/loaders/pcboard.c
@@ -33,7 +33,8 @@ struct pcbChar {
uint8_t character;
};
-int ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_pcboard(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loaders/tundra.c b/src/loaders/tundra.c
@@ -29,7 +29,8 @@
#define TUNDRA_COLOR_FOREGROUND 4
#define TUNDRA_COLOR_BOTH 6
-int ansilove_tundra(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_tundra(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loaders/xbin.c b/src/loaders/xbin.c
@@ -20,7 +20,8 @@
#include "fonts.h"
#include "output.h"
-int ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options)
+int
+ansilove_xbin(struct ansilove_ctx *ctx, struct ansilove_options *options)
{
if (ctx == NULL || options == NULL) {
if (ctx)
diff --git a/src/loadfile.c b/src/loadfile.c
@@ -18,7 +18,8 @@
#include "ansilove.h"
int
-ansilove_loadfile(struct ansilove_ctx *ctx, char *input) {
+ansilove_loadfile(struct ansilove_ctx *ctx, char *input)
+{
int fd;
struct stat st;
diff --git a/src/output.c b/src/output.c
@@ -14,7 +14,9 @@
#include "ansilove.h"
#include "output.h"
-int output(struct ansilove_ctx *ctx, struct ansilove_options *options, gdImagePtr im_Source) {
+int
+output(struct ansilove_ctx *ctx, struct ansilove_options *options, gdImagePtr im_Source)
+{
/* XXX Error handling */
/* XXX The caller must invoke gdFree() */
/* XXX Allow combining DOS aspect ratio and Retina */
diff --git a/src/savefile.c b/src/savefile.c
@@ -14,7 +14,8 @@
#include "ansilove.h"
int
-ansilove_savefile(struct ansilove_ctx *ctx, char *output) {
+ansilove_savefile(struct ansilove_ctx *ctx, char *output)
+{
if (ctx == NULL || output == NULL) {
if (ctx)
ctx->error = ANSILOVE_INVALID_PARAM;