int visible;
int start;
int end;
- int value;
- int num_ticks;
+ unsigned value;
+ unsigned num_ticks;
int start_angle;
int ticks_disappear;
char *theme_dir;
/* Unicode symbol of degrees (a circle, U+b0). Put here in UTF-8 to
avoid potential problem with text file reesncoding */
|| grub_strcmp (ptr, "\xc2\xb0") == 0)
- angle = (angle * 64 + 45) / 90;
+ {
+ if (angle >= 0)
+ angle = ((unsigned) angle * 64 + 45) / 90;
+ else
+ angle = -((unsigned) -angle * 64 + 45) / 90;
+ }
return angle;
}
tracklen += thumb_vertical_pad;
tracktop -= thumb->get_top_pad (thumb);
}
- int thumby = tracktop + tracklen * (value - min) / (max - min);
- int thumbheight = tracklen * extent / (max - min) + 1;
+ int thumby = tracktop + tracklen * (value - min) / (unsigned) (max - min);
+ int thumbheight = tracklen * extent / (unsigned) (max - min) + 1;
/* Rare occasion: too many entries or too low height. */
if (thumbheight < thumb_vertical_pad)
{
thumbheight = thumb_vertical_pad;
thumby = tracktop + ((tracklen - thumb_vertical_pad) * (value - min)
- / (max - extent));
+ / (unsigned)(max - extent));
}
int thumbx = frame->get_left_pad (frame);
int thumbwidth = scrollbar_width - frame_horizontal_pad;
hlheight -= hl_v_pad;
barwidth = (tracklen * (self->value - self->start)
- / (self->end - self->start));
+ / (unsigned) (self->end - self->start));
if (barwidth >= hl_h_pad)
{
(pl) = __m0 * __m1; \
} while (0)
#define UMUL_TIME 46
-#ifndef LONGLONG_STANDALONE
+#if 0
#define udiv_qrnnd(q, r, n1, n0, d) \
do { UDItype __r; \
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
#define UMUL_TIME 40
#define UDIV_TIME 80
#endif
-#ifndef LONGLONG_STANDALONE
+#if 0
#define udiv_qrnnd(q, r, n1, n0, d) \
do { USItype __r; \
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
#define UMUL_TIME 39 /* 39 instructions */
#endif
#ifndef udiv_qrnnd
-#ifndef LONGLONG_STANDALONE
+#if 0
#define udiv_qrnnd(q, r, n1, n0, d) \
do { USItype __r; \
(q) = __udiv_qrnnd (&__r, (n1), (n0), (d)); \
rp = res->d;
ep = expo->d;
- if (!msize)
- msize = 1 / msize; /* Provoke a signal. */
-
if (!esize)
{
/* Exponent is zero, result is 1 mod MOD, i.e., 1 or 0 depending
case 0:
/* We are asked to divide by zero, so go ahead and do it! (To make
the compiler not remove this statement, return the value.) */
- return 1 / dsize;
+ return 0;//1 / dsize;
case 1:
{
y = datetime->year - a;
m = datetime->month + 12 * a - 2;
- return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7;
+ return ((unsigned)(datetime->day + y + y / 4 - y / 100 + y / 400
+ + (31 * m / 12))) % 7;
}
const char *
case '/':
y = npop();
x = npop();
- npush(y ? (x / y) : 0);
+ npush(y ? ((unsigned) x / (unsigned) y) : 0);
break;
case 'm':
y = npop();
x = npop();
- npush(y ? (x % y) : 0);
+ npush(y ? ((unsigned) x % (unsigned) y) : 0);
break;
case 'A':
static inline signed
grub_fixed_sfs_divide (signed a, grub_fixed_signed_t b)
{
- return (a * GRUB_FIXED_1) / b;
+ if (b < 0)
+ {
+ b = -b;
+ a = -a;
+ }
+ if (a < 0)
+ return -((unsigned) a * GRUB_FIXED_1) / (unsigned) b;
+ return ((unsigned) a * GRUB_FIXED_1) / (unsigned) b;
}
static inline grub_fixed_signed_t
grub_fixed_fsf_divide (grub_fixed_signed_t a, signed b)
{
- return a / b;
+ if (b < 0)
+ {
+ b = -b;
+ a = -a;
+ }
+ if (a < 0)
+ return -(unsigned) a / (unsigned) b;
+ return (unsigned) a / (unsigned) b;
}
static inline signed