[Nut-upsdev] Driver for Powercom BNT/KIN/IMP/IMD series

Charles Lepple clepple at gmail.com
Tue Jan 22 13:33:50 UTC 2008


On Jan 22, 2008, at 7:25 AM, Michael Tokarev wrote:

> Ughrm... That driver is very poorly written and needs quite
> some work before it will be acceptable... ;)  I already sent
> some notes to Alexey, but he didn't reply.  Here are some
> notes:

Well, it is in the trunk... plenty of time to fix things before it  
would be in danger of being released.

> o code like this is everywhere:
>
>         if ( types[type].name=="BNT") ...
>
>  it works only with recent GCC which places identical string
>  literals into the same place in memory.  There's no word in
>  C standards that this construct will work or not - the behavior
>  is undefined.

Attached is a quick patch for that.

However, given the number of times where this construct is used, I  
would recommend using some constants and checking for integer equality.

-- 
Charles Lepple
clepple at gmail


-------------- next part --------------
A non-text attachment was scrubbed...
Name: powercom-string-fix.patch.gz
Type: application/x-gzip
Size: 1127 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/nut-upsdev/attachments/20080122/baf53b15/attachment.bin 


More information about the Nut-upsdev mailing list