----------------------------------------
> Date: Mon, 4 May 2015 07:59:31 +0200
> Subject: Re: Operations.c: DFGet() called from consumers/dfconvert/main.c
> From: [email protected]
> To: [email protected]
>
> On Monday, May 4, 2015, Gabriela Gibson <[email protected]> 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.

To keep the semantics you can do r = SUCCESS instead of r = 0; and define 
SUCCESS somewhere

franz


                                          

Reply via email to