X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/c12598a62e2e31f3377c52fe4b283b710ce1451e..44782dea433ce567bf69612a74b62432d68cd4b3:/src/vm-limit.c diff --git a/src/vm-limit.c b/src/vm-limit.c index 015f3ee211..d32050fd01 100644 --- a/src/vm-limit.c +++ b/src/vm-limit.c @@ -1,12 +1,12 @@ /* Functions for memory limit warnings. - Copyright (C) 1990, 1992, 2001-2014 Free Software Foundation, Inc. + Copyright (C) 1990, 1992, 2001-2016 Free Software Foundation, Inc. This file is part of GNU Emacs. GNU Emacs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. +the Free Software Foundation, either version 3 of the License, or (at +your option) any later version. GNU Emacs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of @@ -170,19 +170,13 @@ check_memory_limits (void) if (new_warnlevel > warnlevel || new_warnlevel == warned_95) { warnlevel = new_warnlevel; - switch (warnlevel) + static char const *const warn_diagnostic[] = { - case warned_75: - (*warn_function) ("Warning: past 75% of memory limit"); - break; - - case warned_85: - (*warn_function) ("Warning: past 85% of memory limit"); - break; - - case warned_95: - (*warn_function) ("Warning: past 95% of memory limit"); - } + "Warning: past 75% of memory limit", + "Warning: past 85% of memory limit", + "Warning: past 95% of memory limit" + }; + warn_function (warn_diagnostic[warnlevel - 1]); } /* Handle going down in usage levels, with some hysteresis. */ else