bibledit / cloud

Source code for Bibledit core library and Cloud binary
GNU General Public License v3.0
12 stars 3 forks source link

Update deprecated API calls #904

Closed teusbenschop closed 11 months ago

teusbenschop commented 1 year ago
executable/bibledit.cpp:57:60: warning: ‘G_APPLICATION_FLAGS_NONE’ is deprecated: Use 'G_APPLICATION_DEFAULT_FLAGS' instead [-Wdeprecated-declarations]
   57 |   application = gtk_application_new ("org.bibledit.linux", G_APPLICATION_FLAGS_NONE);
executable/bibledit.cpp:169:15: error: ‘MAXPATHLEN’ was not declared in this scope; did you mean ‘MAXNAMLEN’?
  169 |     char cwd [MAXPATHLEN];
      |               ^~~~~~~~~~
      |               MAXNAMLEN

In the above, it's better to use PATH_MAX instead of MAXPATHLEN. See among others this article: https://patchwork.ozlabs.org/project/netdev/patch/20150425203327.GA9433@euler/

teusbenschop commented 11 months ago

It was tried to use G_APPLICATION_DEFAULT_FLAGS instead of G_APPLICATION_FLAGS_NONE but that gave a compile error on Ubuntu 22.04.

Screenshot 2023-07-22 at 16 57 16

In other words, it is still too early to switch to replace the deprecated value with the new value.

teusbenschop commented 11 months ago

About MAXPATHLEN, the included sqlite3.c uses it multiple times.

This code is from an external source.

If MAXPATHLEN in the bibledit code was updated, then it would still be in the sqlite3.c file.

Perhaps it's good to leave it for just now.

teusbenschop commented 11 months ago

Perhaps one way is something similar to this (taken from the Net-SNMP library):

#ifndef PATH_MAX
# ifdef _POSIX_PATH_MAX
#  define PATH_MAX _POSIX_PATH_MAX
# else
#  define PATH_MAX 255
# endif
#endif
teusbenschop commented 11 months ago

Here is the confirmation that the fix worked and that it now builds on architecture "hurd-i386".

hurd-i386 | 5.1.005-1 | Installed | 3h 14m | ironforge |   | misc | old | all (1) | giveback

https://buildd.debian.org/status/package.php?p=bibledit-cloud