Re: [Tracker] REVIEW: external-crawler branch, part4



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


c5d068279c9db7ac45e577b18b38d0bcb62b1d06

+       guint external_crawler : 1; /* TRUE if we're being feed files
+                                    * instead of discovering them
+                                    * ourselves */
+       guint mtime_checking : 1;   /* TRUE if mtime checks should be done
+                                    * during initial crawling. */
+       guint initial_crawling : 1; /* TRUE if initial crawling should be
+                                    * done */

What is this compiler and platform specific bitfield fscking all about?

What is wrong with gboolean here? I know we are in a financial crisis
since 2008, but bits are not that expensive that we have to do crazy
about it.

It will mess up your alignment and padding and that makes future API
changes more difficult. You'll need to know how the bit fields will
happen on each architecture and compiler.

I think this is one of those "No you C developer. No. You should not
use bitfields in structs. You should use int like everybody else for
booleans (or gboolean in GLib)."

In the old code bitfields were also used for this. Equally wrong imho.

In general for code that is not in ie. the kernel: you should probably
not be using bitfields. Probably never.

For networking code it's just wrong because of padding/alignment (use
&, ~, << and >> instead to fiddle with bits).

Kind regards,

Philip
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.20 (MingW32)

iQEcBAEBAgAGBQJT5JBeAAoJEEP2NSGEz4aDwAkH/0chgYmAQ4PymebGk8aeijFA
EKxsJvHUJkwyNCMYzwq0qMzmup+sFkMUKGp4xtDBYVi9NrQ3P8CKoznYdhjQ9DNc
yibR6bZw/e7zfAHQd/YIxY+aeL8i/RoholhwZVLdEr8DMY0YICS0M9dQ9j18nvjw
2E+61jAWConTPAHC9ol74fvoEgcUx5dsfRuHRH6QXRzluIuJ/x7XXiwBL6l4dnzJ
qztznwD1LNS+LwVuA7GpPsSv15i1cEHTfufqPI1Uu9/0surgdGffczuKlA+eE5xe
7Cq0sOZsCPzFMSNcdFiL++Z/HRmwv5WjVKsCijccDRITiZf5C/I/D+GnAepgWl0=
=TziL
-----END PGP SIGNATURE-----


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]