Re: [PATCH 01/14] wmkeys compilation bugs

"Rodolfo García Peñas (kix)" <[email protected]>
Newsgroups gmane.compw.window-managers.windowmaker.devel
Message-ID <[email protected]>
Hi,

I modified all other dockapps.

The wmbiff dockapp includes a different wmgeneral library. This  
dockapp doesn't compile. I don't include this new code in libdockapps  
because include code of application that doesn't compile IMO is not a  
good idea.

Probably we should try to compile the wmbiff dockapps, and then, think  
about include or not the three new functions in libdockapp.

Cheers,
kix

"Rodolfo García Peñas (kix)" <[email protected]> escribió:

> This patch solves a bug and a warning:
>
> - The dockapp wmkeys uses the getline function, that is the same
>   function provided by stdio.h. This patch changes the function
>   name to getline_wmkeys.
> - The main function returns void, and should return integer. This
>   patch includes the return 0 at the function end and it changes
>   the function prototype.
>
> Signed-off-by: Rodolfo García Peñas (kix) <[email protected]>
> ---
>  wmkeys/wmkeys.c | 10 ++++++----
>  1 file changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/wmkeys/wmkeys.c b/wmkeys/wmkeys.c
> index 718ccd5..72d98e7 100644
> --- a/wmkeys/wmkeys.c
> +++ b/wmkeys/wmkeys.c
> @@ -94,7 +94,7 @@ void enable_configuration(int n);
>   * Main
>   */
>
> -void main(int argc, char *argv[])
> +int main(int argc, char *argv[])
>  {
>    num_configs = 0;
>    current_config = 0;
> @@ -105,6 +105,8 @@ void main(int argc, char *argv[])
>
>    read_config();
>    wmkeys_routine(argc, argv);
> +
> +  return 0;
>  }
>
>  /*
> @@ -179,7 +181,7 @@ void draw_string(char* s)
>   * getline()
>   */
>
> -int getline(FILE* pfile, char* s, int lim)
> +int getline_wmkeys(FILE* pfile, char* s, int lim)
>  {
>    int c = 0, i;
>    for(i=0; i<lim-1 && (c=fgetc(pfile)) != EOF && c!='\n'; ++i) {
> @@ -226,10 +228,10 @@ void read_config()
>    }
>
>    while(!feof(pfile)) {
> -    getline(pfile, key, 256);
> +    getline_wmkeys(pfile, key, 256);
>
>      if(!feof(pfile)) {
> -      getline(pfile, value, 256);
> +      getline_wmkeys(pfile, value, 256);
>
>        configs[num_configs].name = malloc(sizeof(char)*strlen(key)+1);
>        strcpy(configs[num_configs].name, key);
> --
> 2.5.0


Rodolfo García Peñas (kix)
http://www.kix.es/


-- 
To unsubscribe, send mail to [email protected].
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.