[sane-devel] rebased patches for epjitsu

m. allan noah kitno455 at gmail.com
Wed Jul 2 14:32:04 UTC 2014


Thanks Peter. I have not had time to apply these, as I was working on
v26. This has a number of fixes, and conflicts somewhat with these
changes. I will cherry pick a few of these changes in the coming
weeks, but probably not the code style ones, as we disagree on those.

allan

On 6/21/14, Peter Marschall <peter at adpm.de> wrote:
> Hi,
>
> with epjitsu v25 included into upstream, I updated my patch-series against
> it.
> Please find it at my github repo
>
> 	https://github.com/marschap/sane-backends/tree/epjitsu-patches
>
> Here's the list of the patches (more descriptions are in the commit
> messages)
>
> * epjitsu: return \0 even when length is zero in sane_read()
>   '\0'-terminate the buffer returned even when size is 0.
>   This is a security measure to help some sloppy clients.
>
> * epjitsu: simplify calls to do_cmd()
>   - initialize cmd args at declaration
>   - don't change & re-use cmd, instead use an alternative variable
>   - use sizeof() to determine the size of cmd & other args
>   This makes the code shorter, and - in my opinion - easier to
> read/understand
>
> * epjitsu: make assignments clearer by using the ?: operator
>   -  use x = (...) ? y : z instead of lengthy if (...) x = y else x = z
>   This makes the code shorter, and - in my opinion - easier to
> read/understand
>
> * epjitsu: introduce & use MAX() & MIN()
>   - express the logical concept clearer my using MIN() and MAX()
>   This makes the code shorter, and - in my opinion - easier to
> read/understand
>
> * epjitsu: use ternary ?: operator in some functions
>   This makes the code shorter, and - in my opinion - easier to
> read/understand
>
> * epjitsu: refactor sane_get_devices()
>   - flexibilize config file format slightly
>   - use sanei functions to get strings
>   - consistent indenting, ...
>   This makes the code - in my opinion - easier to read/understand
>
> * epjitsu.c: fix typo
>    - just s small typo fix
>
> * epjitsu: remove unused value OPT_Y_RES from 'scanner_Option' enum
>   - remove unused enum value
>   Avoid confusion by removing unusecd parts
>
> * epjitsu: remove unused properties y_res_* of struct scanner
>   - remove unused properties
>   Avoid confusion by removing unusecd parts
>
> * epjitsu: bug fix - avoid overrunning x_res_list in struct scanner
>   - extend size of x_rese_lsit to avoid variable overrun
>   Security fix
>
> * epjitsu: refactor attach_one() - split out init_options()
>   Re-factoring to have shorter functions, which are easier to
> read/understand
>
> * epjitsu: refactor attach_one() - split out init_model()
>   Re-factoring to have shorter functions, which are easier to
> read/understand
>
> * epjitsu: instrument finecal_send_cal() & finecal_get_line() with DBG()
> calls
>   Consistency with other functions / improved debugging
>
> * epjitsu: fix start & finish DBG() calls in coarsecal*()
>   Consistency with other functions / improved debugging
>
> * epjitsu: refactor attach_one() - split out init_user()
>   Shorter functions / make user defaults explicit
>
> * epjitsu: sane_start() - get hardware status at least once
>    With some clients I seem to need this for S1300i
>
> * epjitsu: enforce range.max >= range.min in option descriptors
>    Security fix - I was bitten by this.
>
> It would be great if they could be included in the upstream of
> sane-backends.
>
> If you do not like all of them, leave those away that you do not like,
> but at least take the security fixes.
>
> Thanks for sane
> Peter
>
> --
> Peter Marschall
> peter at adpm.de
>
>
> --
> sane-devel mailing list: sane-devel at lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/sane-devel
> Unsubscribe: Send mail with subject "unsubscribe your_password"
>              to sane-devel-request at lists.alioth.debian.org
>


-- 
"The truth is an offense, but not a sin"



More information about the sane-devel mailing list