aboutsummaryrefslogtreecommitdiffstats
path: root/FunctionBar.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:00:27 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:00:27 +0200
commit283707c5e5bc436b78ea23bf5500cb6b16a01148 (patch)
treeb977131bbbb4c3bd8ade370aab2e4fc913440c04 /FunctionBar.c
parentbea9b4798717b6f4e31085506dfc179eeb8dc17c (diff)
downloaddebian_htop-283707c5e5bc436b78ea23bf5500cb6b16a01148.tar.gz
debian_htop-283707c5e5bc436b78ea23bf5500cb6b16a01148.tar.bz2
debian_htop-283707c5e5bc436b78ea23bf5500cb6b16a01148.zip
Imported Upstream version 0.9upstream/0.9
Diffstat (limited to 'FunctionBar.c')
-rw-r--r--FunctionBar.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/FunctionBar.c b/FunctionBar.c
index a66d74c..ee65333 100644
--- a/FunctionBar.c
+++ b/FunctionBar.c
@@ -1,6 +1,6 @@
/*
htop - FunctionBar.c
-(C) 2004-2006 Hisham H. Muhammad
+(C) 2004-2010 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
@@ -36,17 +36,17 @@ char* FUNCTIONBAR_CLASS = "FunctionBar";
#define FUNCTIONBAR_CLASS NULL
#endif
-static char* FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL};
+static const char* FunctionBar_FKeys[] = {"F1", "F2", "F3", "F4", "F5", "F6", "F7", "F8", "F9", "F10", NULL};
-static char* FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL};
+static const char* FunctionBar_FLabels[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", " ", NULL};
static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)};
-FunctionBar* FunctionBar_new(char** functions, char** keys, int* events) {
+FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* events) {
FunctionBar* this = malloc(sizeof(FunctionBar));
Object_setClass(this, FUNCTIONBAR_CLASS);
((Object*) this)->delete = FunctionBar_delete;
- this->functions = functions;
+ this->functions = (char**) functions;
if (keys && events) {
this->staticData = false;
this->functions = malloc(sizeof(char*) * 15);
@@ -62,8 +62,8 @@ FunctionBar* FunctionBar_new(char** functions, char** keys, int* events) {
this->size = i;
} else {
this->staticData = true;
- this->functions = functions ? functions : FunctionBar_FLabels;
- this->keys = FunctionBar_FKeys;
+ this->functions = (char**)( functions ? functions : FunctionBar_FLabels );
+ this->keys = (char**) FunctionBar_FKeys;
this->events = FunctionBar_FEvents;
this->size = 10;
}
@@ -84,7 +84,7 @@ void FunctionBar_delete(Object* cast) {
free(this);
}
-void FunctionBar_setLabel(FunctionBar* this, int event, char* text) {
+void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) {
assert(!this->staticData);
for (int i = 0; i < this->size; i++) {
if (this->events[i] == event) {

© 2014-2024 Faster IT GmbH | imprint | privacy policy