wmtop: Use proper int types.
commit5fd5619cc484c6ee9d1c9c3e06561003abea36fe
authorDoug Torrance <dtorrance@piedmont.edu>
Mon, 8 Feb 2016 02:36:23 +0000 (7 21:36 -0500)
committerCarlos R. Mafra <crmafra@gmail.com>
Mon, 8 Feb 2016 13:47:21 +0000 (8 19:17 +0530)
treed67ec2d3873b21964f776fce5735ddd9b0c478ff
parent9450f4cfd2af670c0ce6c6d76302c6f965191d04
wmtop: Use proper int types.

Based partially on a patch by wbk to fix Gentoo bug #410093 [1].  From the
bug report:

  After fixing the /proc/meminfo issue, another bug will emerge on systems
  where total system RAM in bytes exceeds INT_MAX. The correct top three
  processes will be identified, but their load bars will have the wrong
  value. This is caused by a value overflow due to storing total system
  memory in an "int" type variable. We will end up thinking ((Total RAM)
  modulo (INT_MAX)) is our total system RAM, so our percentages will be
  inflated when drawing the load bar. This fix will require a bit more care
  to follow the flow of data and ensure this value isn't being cast to "int"
  along the way. Function return types will need to be changed.

[1] https://bugs.gentoo.org/show_bug.cgi?id=410093
wmtop/wmtop.c