mirror of
https://git.savannah.gnu.org/git/grub.git
synced 2026-10-29 02:31:05 +00:00
Remove all signed divisions
This commit is contained in:
1 parent
5d20f9b0e7
commit
739b471725
9 files changed
+36
-19
No files matched your search
+16
-2
@@ -123,13 +123,27 @@ typedef signed grub_fixed_signed_t;
|
||||
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
|
||||
|
||||
Reference in new issue
Block a user