qemu-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-commits] [qemu/qemu] e7b47c: osdep.h: Make TIME_MAX handle differe


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] e7b47c: osdep.h: Make TIME_MAX handle different time_t typ...
Date: Fri, 24 Nov 2017 07:12:46 -0800

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: e7b47c22e2df14d55e3e4426688c929bf8e3f7fb
      
https://github.com/qemu/qemu/commit/e7b47c22e2df14d55e3e4426688c929bf8e3f7fb
  Author: Peter Maydell <address@hidden>
  Date:   2017-11-24 (Fri, 24 Nov 2017)

  Changed paths:
    M include/qemu/osdep.h

  Log Message:
  -----------
  osdep.h: Make TIME_MAX handle different time_t types

In our various supported host OSes, the time_t type may be either 32
or 64 bit, and could in theory also be either signed or unsigned.
Notably, in OpenBSD time_t is a 64 bit type even if 'long' is 32
bits, so using LONG_MAX for TIME_MAX is incorrect.

Use an approach suggested by Paolo Bonzini which calculates
the maximum value of the type rather than hardcoding it;
to do this we use the TYPE_MAXIMUM macro from Gnulib.

Suggested-by: Paolo Bonzini <address@hidden>
Signed-off-by: Peter Maydell <address@hidden>
Reviewed-by: Paolo Bonzini <address@hidden>
Message-id: address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]