0 or -1 / _Bool or int

From: Andreas Schulze <sca_at_andreasschulze.de>
Date: Sat, 10 Dec 2011 23:53:35 +0100

hello,

I let create a daily dump of my statistics db. I found the message table
entries mostly end with -1,0.
For me that are the atsp and spam fields defined in the same way:
        atps integer not null default -1,
        spam integer not null default -1,
I ask me, why the lines end not -1,-1 ...

looking in the source I found 2 variables: mctx_atps defined as int and
mctx_spam defined as _Bool.

mctx_atps is initialized with DKIM_ATPS_UNKNOWN (-1)
mctx_spam is not explicit initialized ( I expect FALSE because of a memzero )
or set TRUE somewhere in the source.

But in opendkim/stats.c/dkimf_stats_record both are declared as int.
I think that results in -1,0 database entries.

Because scripts like opendkim-gengraphs contains sqlcode like
"AND NOT spam = -1", I applied the attached patch to write -1 instead of 0.

Am I wrong?

Andreas


-- 
########################################################################
#
# Andreas Schulze
# https://andreasschulze.de
#
# GnuPG Key-ID: A7DBA67F, https://andreasschulze.de/sca.asc
# GnuPG Fingerprint: 14C1 39A8 CE6D 6BE0 28C6 5652 03B5 6793 A7DB A67F
#
# $Id: .signature,v 1.3 2007-12-27 21:13:36 sca Exp $
########################################################################



Received on Sat Dec 10 2011 - 22:53:08 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:33:14 PST