--- a/dlls/comctl32/taskdialog.c
+++ b/dlls/comctl32/taskdialog.c
@@ -320,7 +320,7 @@ static unsigned int taskdialog_add_buttons(struct taskdialog_template_desc *desc
     /* Try to balance lines so they are about the same size */
     for (i = 1; i < line_count - 1; i++)
     {
-        int diff_now = abs(line_widths[i] - line_widths[i - 1]);
+        int diff_now = abs((int)(line_widths[i] - line_widths[i - 1]));
         unsigned int j, last_button = 0;
         int diff_changed;
 
@@ -329,7 +329,7 @@ static unsigned int taskdialog_add_buttons(struct taskdialog_template_desc *desc
                 last_button = j;
 
         /* Difference in length of both lines if we wrapped the last button from the last line into this one */
-        diff_changed = abs(2 * buttons[last_button].width + line_widths[i] - line_widths[i - 1]);
+        diff_changed = abs((int)(2 * buttons[last_button].width + line_widths[i] - line_widths[i - 1]));
 
         if (diff_changed < diff_now)
         {
