killing some bad magic numbers

This commit is contained in:
Tonton Th 2020-01-22 09:33:35 +01:00
parent d3c52d6127
commit 6ac0caa54a

View File

@ -27,7 +27,9 @@ int idx, nbpixels;
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
#endif
if (3 != a->type || 3 != b->type || 3 != d->type) {
if (FIMG_TYPE_RGB != a->type ||
FIMG_TYPE_RGB != b->type ||
FIMG_TYPE_RGB != d->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -54,7 +56,7 @@ int idx, nbpixels;
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
#endif
if (3 != a->type || 3 != b->type) {
if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -81,7 +83,9 @@ int idx, nbpixels;
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
#endif
if (3 != a->type || 3 != b->type || 3 != d->type) {
if (FIMG_TYPE_RGB != a->type ||
FIMG_TYPE_RGB != b->type ||
FIMG_TYPE_RGB != d->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -111,7 +115,7 @@ int idx, nbpixels;
fprintf(stderr, ">>> %s ( %p %p )\n", __func__, a, b);
#endif
if (3 != a->type || 3 != b->type) {
if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -124,6 +128,7 @@ for (idx=0; idx<nbpixels; idx++) {
b->B[idx] *= a->B[idx];
}
return 0;
}
/* ---------------------------------------------------------------- */
/*
@ -137,7 +142,8 @@ int idx, nbpixels;
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
#endif
if (3 != a->type || 3 != b->type || 3 != d->type) {
if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type ||
FIMG_TYPE_RGB != d->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -161,7 +167,8 @@ int idx, nbiter;
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
#endif
if (3 != a->type || 3 != b->type || 3 != d->type) {
if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type ||
FIMG_TYPE_RGB != d->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}
@ -186,7 +193,8 @@ int idx, nbiter;
fprintf(stderr, ">>> %s ( %p %p %p )\n", __func__, a, b, d);
#endif
if (3 != a->type || 3 != b->type || 3 != d->type) {
if (FIMG_TYPE_RGB != a->type || FIMG_TYPE_RGB != b->type ||
FIMG_TYPE_RGB != d->type) {
fprintf(stderr, "%s : got a bad type fimg\n", __func__);
return -8;
}