summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOneric <oneric@oneric.stub>2020-05-04 00:35:37 +0200
committerOleg Oshmyan <chortos@inbox.lv>2020-07-05 21:49:20 +0300
commita1cc8f2f189ee9401e43a11253c75d47e863fddc (patch)
tree8bd2ddf4ddfe77e0b927d759dd0608b5cc137214
parentaf00ba9f32b401879b43210db530bbff4c30ddfa (diff)
downloadlibass-a1cc8f2f189ee9401e43a11253c75d47e863fddc.tar.bz2
libass-a1cc8f2f189ee9401e43a11253c75d47e863fddc.tar.xz
Style-Nit: Adjust whitespaces
- Convert tabs to spaces - Ensure one space between keywords and parenthesis - Ensure space between ')' and '{' - Trim trailing whitespace
-rw-r--r--libass/ass.c22
-rw-r--r--libass/ass_coretext.c2
-rw-r--r--libass/ass_directwrite.c2
-rw-r--r--libass/ass_font.c2
-rw-r--r--libass/ass_utils.c4
-rw-r--r--libass/dwrite_c.h8
-rw-r--r--profile/profile.c6
7 files changed, 23 insertions, 23 deletions
diff --git a/libass/ass.c b/libass/ass.c
index b965e4c..69df1b9 100644
--- a/libass/ass.c
+++ b/libass/ass.c
@@ -240,8 +240,8 @@ static long long string2timecode(ASS_Library *library, char *p)
}
#define NEXT(str,token) \
- token = next_token(&str); \
- if (!token) break;
+ token = next_token(&str); \
+ if (!token) break;
#define ALIAS(alias,name) \
@@ -261,13 +261,13 @@ static long long string2timecode(ASS_Library *library, char *p)
#define PARSE_END }
#define ANYVAL(name,func) \
- } else if (ass_strcasecmp(tname, #name) == 0) { \
- target->name = func(token);
+ } else if (ass_strcasecmp(tname, #name) == 0) { \
+ target->name = func(token);
#define STRVAL(name) \
- } else if (ass_strcasecmp(tname, #name) == 0) { \
- if (target->name != NULL) free(target->name); \
- target->name = strdup(token);
+ } else if (ass_strcasecmp(tname, #name) == 0) { \
+ if (target->name != NULL) free(target->name); \
+ target->name = strdup(token);
#define STARREDSTRVAL(name) \
} else if (ass_strcasecmp(tname, #name) == 0) { \
@@ -279,12 +279,12 @@ static long long string2timecode(ASS_Library *library, char *p)
#define INTVAL(name) ANYVAL(name,atoi)
#define FPVAL(name) ANYVAL(name,ass_atof)
#define TIMEVAL(name) \
- } else if (ass_strcasecmp(tname, #name) == 0) { \
- target->name = string2timecode(track->library, token);
+ } else if (ass_strcasecmp(tname, #name) == 0) { \
+ target->name = string2timecode(track->library, token);
#define STYLEVAL(name) \
- } else if (ass_strcasecmp(tname, #name) == 0) { \
- target->name = lookup_style(track, token);
+ } else if (ass_strcasecmp(tname, #name) == 0) { \
+ target->name = lookup_style(track, token);
static char *next_token(char **str)
{
diff --git a/libass/ass_coretext.c b/libass/ass_coretext.c
index d9e4c94..0de54ed 100644
--- a/libass/ass_coretext.c
+++ b/libass/ass_coretext.c
@@ -29,7 +29,7 @@
#include "ass_coretext.h"
-#define SAFE_CFRelease(x) do { if (x) CFRelease(x); } while(0)
+#define SAFE_CFRelease(x) do { if (x) CFRelease(x); } while (0)
static const ASS_FontMapping font_substitutions[] = {
{"sans-serif", "Helvetica"},
diff --git a/libass/ass_directwrite.c b/libass/ass_directwrite.c
index d15cbcd..399aef7 100644
--- a/libass/ass_directwrite.c
+++ b/libass/ass_directwrite.c
@@ -204,7 +204,7 @@ static HRESULT STDMETHODCALLTYPE FallbackLogTextRenderer_QueryInterface(
static void init_FallbackLogTextRenderer(FallbackLogTextRenderer *r,
IDWriteFactory *factory)
{
- *r = (FallbackLogTextRenderer){
+ *r = (FallbackLogTextRenderer) {
.iface = {
.lpVtbl = &r->vtbl,
},
diff --git a/libass/ass_font.c b/libass/ass_font.c
index 5f29c2a..80172ad 100644
--- a/libass/ass_font.c
+++ b/libass/ass_font.c
@@ -87,7 +87,7 @@ uint32_t ass_font_index_magic(FT_Face face, uint32_t symbol)
if (!face->charmap)
return symbol;
- switch(face->charmap->encoding){
+ switch (face->charmap->encoding) {
case FT_ENCODING_MS_SYMBOL:
return 0xF000 | symbol;
default:
diff --git a/libass/ass_utils.c b/libass/ass_utils.c
index 8cd639d..99e2c52 100644
--- a/libass/ass_utils.c
+++ b/libass/ass_utils.c
@@ -46,11 +46,11 @@ int has_avx(void)
{
uint32_t eax = 1, ebx, ecx, edx;
ass_get_cpuid(&eax, &ebx, &ecx, &edx);
- if(!(ecx & (1 << 27))) // not OSXSAVE
+ if (!(ecx & (1 << 27))) // not OSXSAVE
return 0;
uint32_t misc = ecx;
ass_get_xgetbv(0, &eax, &edx);
- if((eax & 0x6) != 0x6)
+ if ((eax & 0x6) != 0x6)
return 0;
eax = 0;
ass_get_cpuid(&eax, &ebx, &ecx, &edx);
diff --git a/libass/dwrite_c.h b/libass/dwrite_c.h
index c902525..d20139b 100644
--- a/libass/dwrite_c.h
+++ b/libass/dwrite_c.h
@@ -56,7 +56,7 @@ typedef enum DWRITE_INFORMATIONAL_STRING_ID {
typedef enum DWRITE_FACTORY_TYPE {
DWRITE_FACTORY_TYPE_SHARED = 0,
- DWRITE_FACTORY_TYPE_ISOLATED
+ DWRITE_FACTORY_TYPE_ISOLATED
} DWRITE_FACTORY_TYPE;
typedef enum DWRITE_FONT_FACE_TYPE {
@@ -73,7 +73,7 @@ typedef enum DWRITE_FONT_FACE_TYPE {
typedef enum DWRITE_FONT_SIMULATIONS {
DWRITE_FONT_SIMULATIONS_NONE = 0x0000,
DWRITE_FONT_SIMULATIONS_BOLD = 0x0001,
- DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
+ DWRITE_FONT_SIMULATIONS_OBLIQUE = 0x0002
} DWRITE_FONT_SIMULATIONS;
typedef enum DWRITE_FONT_STRETCH {
@@ -87,13 +87,13 @@ typedef enum DWRITE_FONT_STRETCH {
DWRITE_FONT_STRETCH_SEMI_EXPANDED = 6,
DWRITE_FONT_STRETCH_EXPANDED = 7,
DWRITE_FONT_STRETCH_EXTRA_EXPANDED = 8,
- DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
+ DWRITE_FONT_STRETCH_ULTRA_EXPANDED = 9
} DWRITE_FONT_STRETCH;
typedef enum DWRITE_FONT_STYLE {
DWRITE_FONT_STYLE_NORMAL = 0,
DWRITE_FONT_STYLE_OBLIQUE,
- DWRITE_FONT_STYLE_ITALIC
+ DWRITE_FONT_STYLE_ITALIC
} DWRITE_FONT_STYLE;
typedef enum DWRITE_FONT_WEIGHT {
diff --git a/profile/profile.c b/profile/profile.c
index 88934d4..4fc1ade 100644
--- a/profile/profile.c
+++ b/profile/profile.c
@@ -73,8 +73,8 @@ int main(int argc, char *argv[])
double tm = strtod(argv[2], 0);
double fps = strtod(argv[3], 0);
double time = strtod(argv[4], 0);
-
- if(fps == 0){
+
+ if (fps == 0) {
printf("fps cannot equal 0\n");
exit(1);
}
@@ -86,7 +86,7 @@ int main(int argc, char *argv[])
exit(1);
}
- while(tm < time){
+ while (tm < time) {
ass_render_frame(ass_renderer, track, (int) (tm * 1000), NULL);
tm += 1 / fps;
}