corinthia-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jan i <j...@apache.org>
Subject Re: Operations.c: DFGet() called from consumers/dfconvert/main.c
Date Mon, 04 May 2015 05:59:31 GMT
On Monday, May 4, 2015, Gabriela Gibson <gabriela.gibson@gmail.com> wrote:

> Right now, consumers/dfconvert/main.c is doing a lot of work but only
> checks it has a file to put it in at the very end of it's effort, in
> Operations.c.  If the file already exists, it bails out with an a error.
>
> I would propose that we do this instead of that, in Operations.c: 355, ie,
> we move the check right up to to point at which we can immediately tell if
> the work done is in vain:
>
>  int DFGetFile(const char *concreteFilename,
>                 const char *abstractFilename,
>                 DFError **error)
>   {
>       int success = 0;
>
>       if (DFFileExists(abstractFilename)) {
>           DFErrorFormat(error,
>                         "%s: File already exists",
>                         abstractFilename);
>           return success;
>       }
>
> ...
>
> I also would like to rename int r = 0; to the (a little more obvious) int
> success = 0;
>
> What do you think?

sounds logical to me.

rgds
jan i

>
> G
>
> --
> Visit my Coding Diary: http://gabriela-gibson.blogspot.com/
>


-- 
Sent from My iPad, sorry for any misspellings.

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message