Skip to content

Commit

Permalink
Fix whitespace issues (cmus#1021)
Browse files Browse the repository at this point in the history
* Fix whitespace issues

* Trailing whitespace.
* Spaces instead of tabs.
* Spaces between brackets and arguments.

* Update scripts/gen_decomp.py
  • Loading branch information
pgaskin authored Dec 17, 2020
1 parent ba1c3f0 commit 3e5db69
Show file tree
Hide file tree
Showing 17 changed files with 68 additions and 68 deletions.
6 changes: 3 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ addons:
packages:
- libmad
- libcddb
script:
script:
- if [ ${TRAVIS_OS_NAME} == "linux" ] && [ ${TRAVIS_COMPILER} == "gcc" ] ; then
./configure CC=/usr/bin/gcc-5 ;
./configure CC=/usr/bin/gcc-5 ;
else
./configure ;
fi
- make

2 changes: 1 addition & 1 deletion cmus-status-display
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# - status (stopped, playing, paused) is always given
# - file or url is given only if track is 'loaded' in cmus
# - other keys/values are given only if they are available
#
#

output()
{
Expand Down
4 changes: 2 additions & 2 deletions compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@
*
*/
#define container_of_portable(ptr, type, member) \
((type *)(void *)( (char *)(ptr) - offsetof(type,member) ))
((type *)(void *)( (char *)(ptr) - offsetof(type,member)))
#undef container_of
#if defined(__GNUC__)
#define container_of(ptr, type, member) __extension__ ({ \
const __typeof__( ((type *)0)->member ) *_mptr = (ptr); \
const __typeof__( ((type *)0)->member) *_mptr = (ptr); \
container_of_portable(_mptr, type, member);})
#else
#define container_of(ptr, type, member) container_of_portable(ptr, type, member)
Expand Down
6 changes: 3 additions & 3 deletions data/rc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ bind browser u win-update
bind common mouse_scroll_up win-up
bind common mouse_scroll_down win-down
bind common mlb_click_selected win-activate
bind common ! push shell
bind common ! push shell
bind common + vol +10%
bind common , seek -1m
bind common - vol -10%
Expand All @@ -23,10 +23,10 @@ bind common ? search-b-start
bind common C toggle continue
bind common D win-remove
bind common E win-add-Q
bind common F push filter
bind common F push filter
bind common G win-bottom
bind common I echo {}
bind common L push live-filter
bind common L push live-filter
bind common M toggle play_library
bind common N search-prev
bind common P win-mv-before
Expand Down
2 changes: 1 addition & 1 deletion glob.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ struct glob_item {
};

/* simplification:
*
*
* ??*? => ???*
* *?* => ?*
* *? => ?*
Expand Down
2 changes: 1 addition & 1 deletion lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ void tree_expand_all(void);
void tree_sel_update(int changed);
void tree_sel_current(int auto_expand_albums);
void tree_sel_first(void);
void tree_sel_track(struct tree_track *t, int auto_expand_albums );
void tree_sel_track(struct tree_track *t, int auto_expand_albums);
int tree_for_each_sel(int (*cb)(void *data, struct track_info *ti), void *data, int reverse, int advance);
int _tree_for_each_sel(int (*cb)(void *data, struct track_info *ti), void *data, int reverse);

Expand Down
2 changes: 1 addition & 1 deletion misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ char *expand_filename(const char *name)
}
}

void shuffle_array(void *array, size_t n, size_t size)
void shuffle_array(void *array, size_t n, size_t size)
{
char tmp[size];
char *arr = array;
Expand Down
16 changes: 8 additions & 8 deletions op/coreaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@
*/

/*
* The text above constitutes the entire PortAudio license; however,
* The text above constitutes the entire PortAudio license; however,
* the PortAudio community also makes the following non-binding requests:
*
* Any person wishing to distribute modifications to the Software is
* requested to send the modifications to the original developer so that
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* they can be incorporated into the canonical version. It is also
* requested that these non-binding requests be included along with the
* license above.
*/

Expand Down Expand Up @@ -317,7 +317,7 @@ static AudioDeviceID coreaudio_find_device(const char *dev_name)
err = AudioObjectGetPropertyData(kAudioObjectSystemObject,
&aopa,
0,
NULL,
NULL,
&property_size,
devices);
if (err != noErr)
Expand Down Expand Up @@ -573,7 +573,7 @@ static OSStatus coreaudio_init_audio_unit(AudioUnit *au,
OSType os_type,
AudioDeviceID dev_id)
{
OSStatus err;
OSStatus err;
AudioComponentDescription comp_desc = {
kAudioUnitType_Output,
os_type,
Expand Down Expand Up @@ -609,7 +609,7 @@ static OSStatus coreaudio_start_audio_unit(AudioUnit *au,
int *frame_size,
AudioStreamBasicDescription desc)
{

OSStatus err;
err = AudioUnitSetProperty(*au,
kAudioUnitProperty_StreamFormat,
Expand Down Expand Up @@ -736,7 +736,7 @@ static OSStatus coreaudio_get_device_stereo_channels(AudioDeviceID dev_id, UInt3
&size,
channels);
return err;
}
}

static int coreaudio_mixer_set_volume(int l, int r)
{
Expand Down Expand Up @@ -843,7 +843,7 @@ static int coreaudio_mixer_close(void)
.mScope = kAudioObjectPropertyScopeOutput,
.mElement = coreaudio_stero_channels[i]
};

err |= AudioObjectRemovePropertyListener(coreaudio_device_id,
&aopa,
coreaudio_device_volume_change_listener,
Expand Down
2 changes: 1 addition & 1 deletion op/oss.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ static struct oss_fmt oss_fmts[] = {
#endif
#ifdef AFMT_U32_LE
{ AFMT_U32_LE, 32, 0, 0 },
#endif
#endif
{ AFMT_S8, 8, 1, 0 },
{ AFMT_S8, 8, 1, 1 },
{ AFMT_U8, 8, 0, 0 },
Expand Down
2 changes: 1 addition & 1 deletion op/roar.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ static int op_roar_open(sample_format_t sf, const channel_position_t *channel_ma
return -OP_ERROR_ERRNO;
}

if ( roar_simple_connect2(&con, NULL, "C* Music Player (cmus)", ROAR_ENUM_FLAG_NONBLOCK, 0) == -1 ) {
if (roar_simple_connect2(&con, NULL, "C* Music Player (cmus)", ROAR_ENUM_FLAG_NONBLOCK, 0) == -1) {
ROAR_DBG("op_roar_open(*) = ?");

roar_err_to_errno();
Expand Down
4 changes: 2 additions & 2 deletions rbtree.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ struct rb_node
struct rb_node *rb_right;
struct rb_node *rb_left;
} __attribute__((aligned(sizeof(long))));
/* The alignment might seem pointless, but allegedly CRIS needs it */
/* The alignment might seem pointless, but allegedly CRIS needs it */

struct rb_root
{
Expand Down Expand Up @@ -153,7 +153,7 @@ void rb_replace_node(struct rb_node *victim, struct rb_node *new,
static inline void rb_link_node(struct rb_node * node, struct rb_node * parent,
struct rb_node ** rb_link)
{
node->rb_parent_color = (unsigned long )parent;
node->rb_parent_color = (unsigned long)parent;
node->rb_left = node->rb_right = NULL;

*rb_link = node;
Expand Down
2 changes: 1 addition & 1 deletion scripts/checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ __compile_failed()
}

# tries to link against a lib
#
#
# @function: some function
# @flags: extra flags (optional)
check_function()
Expand Down
4 changes: 2 additions & 2 deletions scripts/gen_decomp.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,13 @@ def output(unidata, f):
''' % os.path.basename(sys.argv[0])
for k in sorted(unidata.keys()):
b = unidata[k]['decomp'][0]
buf += '\t{ %#6x, %#6x },\t// %s -> %s,\t%s\n' % \
buf += ('\t{ %#6x, %#6x },\t// %s -> %s,\t%s' % \
(k, b,
unichr(k).encode('utf-8'),
unichr(b).encode('utf-8'),
', '.join([' %s (%x)' %
(unichr(d).encode('utf-8'), d)
for d in unidata[k]['decomp'][1:]]))
for d in unidata[k]['decomp'][1:]]))).rstrip() + '\n'
buf += '};'
f.write(buf+'\n')

Expand Down
18 changes: 9 additions & 9 deletions tree.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,10 +650,10 @@ static int special_name_cmp(const char *a, const char *collkey_a,

static inline const char *album_sort_collkey(const struct album *a)
{
if (a->sort_name)
return a->collkey_sort_name;
if (a->sort_name)
return a->collkey_sort_name;

return a->collkey_name;
return a->collkey_name;
}

static int special_album_cmp(const struct album *a, const struct album *b)
Expand All @@ -678,13 +678,13 @@ static int special_album_cmp_date(const struct album *a, const struct album *b)
/* has to follow the same logic as artist_sort_name() */
static inline const char *artist_sort_collkey(const struct artist *a)
{
if (a->sort_name)
return a->collkey_sort_name;
if (a->sort_name)
return a->collkey_sort_name;

if (smart_artist_sort && a->auto_sort_name)
return a->collkey_auto_sort_name;
if (smart_artist_sort && a->auto_sort_name)
return a->collkey_auto_sort_name;

return a->collkey_name;
return a->collkey_name;
}

static struct artist *do_find_artist(const struct artist *artist,
Expand Down Expand Up @@ -1259,7 +1259,7 @@ void tree_sel_first(void)
}
}

void tree_sel_track(struct tree_track *t, int auto_expand_albums )
void tree_sel_track(struct tree_track *t, int auto_expand_albums)
{
if (t) {
struct iter iter;
Expand Down
14 changes: 7 additions & 7 deletions uchar.c
Original file line number Diff line number Diff line change
Expand Up @@ -574,14 +574,14 @@ int u_skip_chars(const char *str, int *width)

static inline uchar u_casefold_char(uchar ch)
{
/* faster lookup for for A-Z, rest of ASCII unaffected */
if (ch < 0x0041)
return ch;
if (ch <= 0x005A)
return ch + 0x20;
/* faster lookup for for A-Z, rest of ASCII unaffected */
if (ch < 0x0041)
return ch;
if (ch <= 0x005A)
return ch + 0x20;
#if defined(_WIN32) || defined(__STDC_ISO_10646__) || defined(__APPLE__)
if (ch < 128)
return ch;
if (ch < 128)
return ch;
ch = towlower(ch);
#endif
return ch;
Expand Down
48 changes: 24 additions & 24 deletions unidecomp.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ static struct {
{ 0xc3, 0x41 }, // Ã -> A, ̃ (303)
{ 0xc4, 0x41 }, // Ä -> A, ̈ (308)
{ 0xc5, 0x41 }, // Å -> A, ̊ (30a)
{ 0xc6, 0x41 }, // Æ -> A,
{ 0xc6, 0x41 }, // Æ -> A,
{ 0xc7, 0x43 }, // Ç -> C, ̧ (327)
{ 0xc8, 0x45 }, // È -> E, ̀ (300)
{ 0xc9, 0x45 }, // É -> E, ́ (301)
Expand All @@ -21,29 +21,29 @@ static struct {
{ 0xcd, 0x49 }, // Í -> I, ́ (301)
{ 0xce, 0x49 }, // Î -> I, ̂ (302)
{ 0xcf, 0x49 }, // Ï -> I, ̈ (308)
{ 0xd0, 0x44 }, // Ð -> D,
{ 0xd0, 0x44 }, // Ð -> D,
{ 0xd1, 0x4e }, // Ñ -> N, ̃ (303)
{ 0xd2, 0x4f }, // Ò -> O, ̀ (300)
{ 0xd3, 0x4f }, // Ó -> O, ́ (301)
{ 0xd4, 0x4f }, // Ô -> O, ̂ (302)
{ 0xd5, 0x4f }, // Õ -> O, ̃ (303)
{ 0xd6, 0x4f }, // Ö -> O, ̈ (308)
{ 0xd7, 0x78 }, // × -> x,
{ 0xd8, 0x4f }, // Ø -> O,
{ 0xd7, 0x78 }, // × -> x,
{ 0xd8, 0x4f }, // Ø -> O,
{ 0xd9, 0x55 }, // Ù -> U, ̀ (300)
{ 0xda, 0x55 }, // Ú -> U, ́ (301)
{ 0xdb, 0x55 }, // Û -> U, ̂ (302)
{ 0xdc, 0x55 }, // Ü -> U, ̈ (308)
{ 0xdd, 0x59 }, // Ý -> Y, ́ (301)
{ 0xde, 0x50 }, // Þ -> P,
{ 0xdf, 0x42 }, // ß -> B,
{ 0xde, 0x50 }, // Þ -> P,
{ 0xdf, 0x42 }, // ß -> B,
{ 0xe0, 0x61 }, // à -> a, ̀ (300)
{ 0xe1, 0x61 }, // á -> a, ́ (301)
{ 0xe2, 0x61 }, // â -> a, ̂ (302)
{ 0xe3, 0x61 }, // ã -> a, ̃ (303)
{ 0xe4, 0x61 }, // ä -> a, ̈ (308)
{ 0xe5, 0x61 }, // å -> a, ̊ (30a)
{ 0xe6, 0x61 }, // æ -> a,
{ 0xe6, 0x61 }, // æ -> a,
{ 0xe7, 0x63 }, // ç -> c, ̧ (327)
{ 0xe8, 0x65 }, // è -> e, ̀ (300)
{ 0xe9, 0x65 }, // é -> e, ́ (301)
Expand All @@ -53,20 +53,20 @@ static struct {
{ 0xed, 0x69 }, // í -> i, ́ (301)
{ 0xee, 0x69 }, // î -> i, ̂ (302)
{ 0xef, 0x69 }, // ï -> i, ̈ (308)
{ 0xf0, 0x64 }, // ð -> d,
{ 0xf0, 0x64 }, // ð -> d,
{ 0xf1, 0x6e }, // ñ -> n, ̃ (303)
{ 0xf2, 0x6f }, // ò -> o, ̀ (300)
{ 0xf3, 0x6f }, // ó -> o, ́ (301)
{ 0xf4, 0x6f }, // ô -> o, ̂ (302)
{ 0xf5, 0x6f }, // õ -> o, ̃ (303)
{ 0xf6, 0x6f }, // ö -> o, ̈ (308)
{ 0xf8, 0x6f }, // ø -> o,
{ 0xf8, 0x6f }, // ø -> o,
{ 0xf9, 0x75 }, // ù -> u, ̀ (300)
{ 0xfa, 0x75 }, // ú -> u, ́ (301)
{ 0xfb, 0x75 }, // û -> u, ̂ (302)
{ 0xfc, 0x75 }, // ü -> u, ̈ (308)
{ 0xfd, 0x79 }, // ý -> y, ́ (301)
{ 0xfe, 0x70 }, // þ -> p,
{ 0xfe, 0x70 }, // þ -> p,
{ 0xff, 0x79 }, // ÿ -> y, ̈ (308)
{ 0x100, 0x41 }, // Ā -> A, ̄ (304)
{ 0x101, 0x61 }, // ā -> a, ̄ (304)
Expand Down Expand Up @@ -806,18 +806,18 @@ static struct {
{ 0x1ffa, 0x3a9 }, // Ὼ -> Ω, ̀ (300)
{ 0x1ffb, 0x3a9 }, // Ώ -> Ω, ́ (301)
{ 0x1ffc, 0x3a9 }, // ῼ -> Ω, ͅ (345)
{ 0x2010, 0x2d }, // ‐ -> -,
{ 0x2012, 0x2d }, // ‒ -> -,
{ 0x2013, 0x2d }, // – -> -,
{ 0x2014, 0x2d }, // — -> -,
{ 0x2015, 0x2d }, // ― -> -,
{ 0x2018, 0x27 }, // ‘ -> ',
{ 0x2019, 0x27 }, // ’ -> ',
{ 0x201c, 0x22 }, // “ -> ",
{ 0x201d, 0x22 }, // ” -> ",
{ 0x2026, 0x2e }, // … -> .,
{ 0x2032, 0x27 }, // ′ -> ',
{ 0x2033, 0x22 }, // ″ -> ",
{ 0x2010, 0x2d }, // ‐ -> -,
{ 0x2012, 0x2d }, // ‒ -> -,
{ 0x2013, 0x2d }, // – -> -,
{ 0x2014, 0x2d }, // — -> -,
{ 0x2015, 0x2d }, // ― -> -,
{ 0x2018, 0x27 }, // ‘ -> ',
{ 0x2019, 0x27 }, // ’ -> ',
{ 0x201c, 0x22 }, // “ -> ",
{ 0x201d, 0x22 }, // ” -> ",
{ 0x2026, 0x2e }, // … -> .,
{ 0x2032, 0x27 }, // ′ -> ',
{ 0x2033, 0x22 }, // ″ -> ",
{ 0x212b, 0x41 }, // Å -> A, ̊ (30a)
{ 0x219a, 0x2190 }, // ↚ -> ←, ̸ (338)
{ 0x219b, 0x2192 }, // ↛ -> →, ̸ (338)
Expand All @@ -828,7 +828,7 @@ static struct {
{ 0x2204, 0x2203 }, // ∄ -> ∃, ̸ (338)
{ 0x2209, 0x2208 }, // ∉ -> ∈, ̸ (338)
{ 0x220c, 0x220b }, // ∌ -> ∋, ̸ (338)
{ 0x2212, 0x2d }, // − -> -,
{ 0x2212, 0x2d }, // − -> -,
{ 0x2224, 0x2223 }, // ∤ -> ∣, ̸ (338)
{ 0x2226, 0x2225 }, // ∦ -> ∥, ̸ (338)
{ 0x2241, 0x223c }, // ≁ -> ∼, ̸ (338)
Expand Down Expand Up @@ -865,5 +865,5 @@ static struct {
{ 0x22ec, 0x22b4 }, // ⋬ -> ⊴, ̸ (338)
{ 0x22ed, 0x22b5 }, // ⋭ -> ⊵, ̸ (338)
{ 0x2adc, 0x2add }, // ⫝̸ -> ⫝, ̸ (338)
{ 0x3003, 0x22 }, // 〃 -> ",
{ 0x3003, 0x22 }, // 〃 -> ",
};
2 changes: 1 addition & 1 deletion utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ static inline uint32_t read_le24(const char *buf)

static inline int32_t read_le24i(const char *buf)
{
uint32_t a = read_le24(buf);
uint32_t a = read_le24(buf);
return (a & 0x800000) ? 0xFF000000 | a : a;
}

Expand Down

0 comments on commit 3e5db69

Please sign in to comment.