On 09/20/2013 09:46 PM, Sedat Dilek wrote:
Is ENABLE_FEATURE_SEAMLESS_GZ missing here?

no, because
1) the function will only be called/compiled if at least one compressor is enabled 2) if gzip is disabled, it's array index (enum value) doesnt change because of that, so the first array must be there anyway (6 bytes). if you put an ifdef around, the only difference is that the entry will be created zero-initialised instead.

...
+    static const char compressor[][6] = {
# if ENABLE_FEATURE_SEAMLESS_GZ
+        [ct_gzip - 1]  = "gzip",
#endif
+#if ENABLE_FEATURE_SEAMLESS_BZ2
+        [ct_bzip2 - 1] = "bzip2",
+#endif
+#if ENABLE_FEATURE_SEAMLESS_XZ
+        [ct_xz - 1]    = "xz",
+#endif
+    };
+    const char *zip_exec = compressor[ct-1];
...
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to