Skip to content

Fix compilation with new gcc #33

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ This release was tested against MarIuX.

## Revision History

### Version 3.0p15 - Jan 18 2022
- fix compilation problems with new gcc version
- Niclas Hofmann, `niclas@molgen.mpg.de`

### Version 3.0p14 - Jul 20 2021
- code fixes and optimizations
- Thomas Kreitler, `kreitler@molgen.mpg.de`

### Version 3.0p13 - Mar 29 2019
- fix , as 1k divider for numerical output
- Niclas Hofmann, `niclas@molgen.mpg.de`
Expand Down
2 changes: 1 addition & 1 deletion version.h
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define XDU_VERSION "3.0p14"
#define XDU_VERSION "3.0p15"
4 changes: 2 additions & 2 deletions xdu.c
Original file line number Diff line number Diff line change
Expand Up @@ -730,10 +730,10 @@ void printpath(int x, int y)
np = findnode(&top, x, y);
if (np == NULL)
return;
asprintf(&path, "%s", np->name);
(void) asprintf(&path, "%s", np->name);
while (np->parent != NULL) {
tmp_path = path;
asprintf(&path, "%s/%s", np->parent->name, path);
(void) asprintf(&path, "%s/%s", np->parent->name, path);
np = np->parent;
free(tmp_path);
}
Expand Down
9 changes: 6 additions & 3 deletions xwin.c
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ static char defaultTranslations[] = "\
ALL_UNUSED_IMPL(VA_NUM_ARGS(__VA_ARGS__)) \
(__VA_ARGS__)

/* Assuming that there will never be a file lager than 999 petabytes. */
#define MAX_NUMBER_LABEL_LENGTH 23

/*
* action routines
*/
Expand Down Expand Up @@ -500,7 +503,7 @@ void xrepaint()

void readable_float(float number, char* number_label)
{
char number_string[1024];
char number_string[MAX_NUMBER_LABEL_LENGTH];
int i, j, length;
sprintf(number_string, "%.2f", number);
length = (strlen(number_string) - 4) / 3 + strlen(number_string);
Expand All @@ -517,7 +520,7 @@ void readable_float(float number, char* number_label)

void readable_long_long(long long number, char* number_label)
{
char number_string[1024];
char number_string[MAX_NUMBER_LABEL_LENGTH];
int i, j, length;
sprintf(number_string, "%lld", number);
length = (strlen(number_string) - 1) / 3 + strlen(number_string);
Expand All @@ -537,7 +540,7 @@ void xdrawrect(char* name, long long size, int x, int y, int width, int height)
int textx,
texty;
char label[1024];
char number_label[1024];
char number_label[MAX_NUMBER_LABEL_LENGTH];
XCharStruct overall;
int ascent,
descent,
Expand Down