summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4032f6c)
raw | patch | inline | side by side (parent: 4032f6c)
author | Thomas Jansen <mithi@mithi.net> | |
Thu, 29 Oct 2009 20:21:33 +0000 (21:21 +0100) | ||
committer | Thomas Jansen <mithi@mithi.net> | |
Thu, 29 Oct 2009 20:21:33 +0000 (21:21 +0100) |
src/command.c | patch | blob | history | |
src/conf.c | patch | blob | history |
diff --git a/src/command.c b/src/command.c
index 6b90e5628965bbd490153095822b8e824b020e94..d8af8565d194b2e937a412fa755e7989ffcfd476 100644 (file)
--- a/src/command.c
+++ b/src/command.c
void
command_dump_keys(void)
{
- int i;
+ int i = 0;
- i = 0;
while (cmds[i].description) {
if (cmds[i].command != CMD_NONE)
printf(" %20s : %s\n", get_key_names(cmds[i].command,1),cmds[i].name);
static int
set_key_flags(command_definition_t *cp, command_t command, int flags)
{
- int i;
+ int i = 0;
- i = 0;
while (cp[i].name) {
if (cp[i].command == command) {
cp[i].flags |= flags;
const char *
get_key_names(command_t command, int all)
{
- int i;
+ int i = 0;
- i=0;
while (cmds[i].description) {
if (cmds[i].command == command) {
int j;
const char *
get_key_description(command_t command)
{
- int i;
+ int i = 0;
- i=0;
while (cmds[i].description) {
if (cmds[i].command == command)
return _(cmds[i].description);
const char *
get_key_command_name(command_t command)
{
- int i;
+ int i = 0;
- i=0;
while (cmds[i].name) {
if (cmds[i].command == command)
return cmds[i].name;
command_t
get_key_command_from_name(char *name)
{
- int i;
+ int i = 0;
- i=0;
while (cmds[i].name) {
if (strcmp(name, cmds[i].name) == 0)
return cmds[i].command;
command_t
find_key_command(int key, command_definition_t *c)
{
- int i;
+ int i = 0;
- i=0;
while (key && c && c[i].name) {
if (c[i].keys[0] == key ||
c[i].keys[1] == key ||
int
assign_keys(command_t command, int keys[MAX_COMMAND_KEYS])
{
- int i;
+ int i = 0;
- i=0;
while (cmds[i].name) {
if (cmds[i].command == command) {
memcpy(cmds[i].keys, keys, sizeof(int)*MAX_COMMAND_KEYS);
int
check_key_bindings(command_definition_t *cp, char *buf, size_t bufsize)
{
- int i;
+ int i = 0;
int retval = 0;
if (cp == NULL)
cp = cmds;
- i=0;
while (cp[i].name) {
cp[i].flags &= ~COMMAND_KEY_CONFLICT;
i++;
}
- i=0;
+ i = 0;
while (cp[i].name) {
int j;
command_t cmd;
int
write_key_bindings(FILE *f, int flags)
{
- int i,j;
+ int i = 0, j;
if (flags & KEYDEF_WRITE_HEADER)
fprintf(f, "## Key bindings for ncmpc (generated by ncmpc)\n\n");
- i = 0;
while (cmds[i].name && !ferror(f)) {
if (cmds[i].flags & COMMAND_KEY_MODIFIED ||
flags & KEYDEF_WRITE_ALL) {
diff --git a/src/conf.c b/src/conf.c
index 3ec37b855776cde142e8eae35e854daa45bb835a..9ff0b55c5e99f00d81644aefc781a5eff2d18b2b 100644 (file)
--- a/src/conf.c
+++ b/src/conf.c
{
char **tmp = g_strsplit_set(value, " \t,", 100);
char **screen = NULL;
- int i,j;
+ int i = 0, j = 0;
- i=0;
- j=0;
while( tmp && tmp[i] ) {
char *name = g_ascii_strdown(tmp[i], -1);
if (*name != '\0') {
static bool
parse_line(char *line)
{
- size_t len = strlen(line), i = 0, j;
+ size_t len = strlen(line), i = 0, j = 0;
char name[MAX_LINE_LENGTH];
char value[MAX_LINE_LENGTH];
bool match_found;
/* get the name part */
- j = 0;
while (i < len && line[i] != '=' &&
!g_ascii_isspace(line[i])) {
name[j++] = line[i++];