Added build fix for with new version of libpaper #30

Merged
MicheleC merged 1 commits from feat/libpaper into master 1 year ago
ormorph commented 1 year ago
Collaborator

Added explicit variable type casting, for compatibility with new versions of the libpaper library.

Added explicit variable type casting, for compatibility with new versions of the libpaper library.
Owner

Hi @ormorph,
looking at the source code in github for libpaper, systempapername() already returns a char*. Nothing wrong with the explicit cast, but why is it suddenly required?

Hi @ormorph, looking at the source code in github for libpaper, `systempapername()` already returns a `char*`. Nothing wrong with the explicit cast, but why is it suddenly required?
obache commented 1 year ago
Collaborator

https://github.com/rrthomas/libpaper
fork? libpaper2?
It change systempapername() to return const char*.

How about to change char *paperName to const char *paperName instead?
It never changed here and following paperinfo(paperName) also accept const char*.

https://github.com/rrthomas/libpaper fork? libpaper2? It change `systempapername()` to return `const char*`. How about to change `char *paperName` to `const char *paperName` instead? It never changed here and following `paperinfo(paperName)` also accept `const char*`.
Owner

Ah thanks, I think I had look at a different github libpaper repository (maybe a fork??).

How about to change char *paperName to const char paperName instead?
It never changed here and following paperinfo(paperName) also accept const char
.

Sounds even better!

Ah thanks, I think I had look at a different github libpaper repository (maybe a fork??). > How about to change char *paperName to const char *paperName instead? It never changed here and following paperinfo(paperName) also accept const char*. Sounds even better!
ormorph commented 1 year ago
Poster
Collaborator

Hi @ormorph,
looking at the source code in github for libpaper, systempapername() already returns a char*. Nothing wrong with the explicit cast, but why is it suddenly required?

In my Gentoo kword build ended with an error:

invalid conversion from «const char*» to «char*» [-fpermissive]

Although I myself don’t understand why this happened, since the function is declared as exern "C" in the header file.
I am attaching an archive with header files for different versions of libpaper. On version 1.1.28, the assembly runs without errors, and on version 2.0.4, errors appear. The difference is in the macros, since in one case a representation without const is used.

> Hi @ormorph, > looking at the source code in github for libpaper, `systempapername()` already returns a `char*`. Nothing wrong with the explicit cast, but why is it suddenly required? In my Gentoo kword build ended with an error: ``` invalid conversion from «const char*» to «char*» [-fpermissive] ``` Although I myself don’t understand why this happened, since the function is declared as `exern "C"` in the header file. I am attaching an archive with header files for different versions of libpaper. On version 1.1.28, the assembly runs without errors, and on version 2.0.4, errors appear. The difference is in the macros, since in one case a representation without `const` is used.
ormorph commented 1 year ago
Poster
Collaborator

How about to change char *paperName to const char *paperName instead?

It will be necessary to check how it all works.

> How about to change char *paperName to const char *paperName instead? It will be necessary to check how it all works.
Owner

How about to change char *paperName to const char *paperName instead?

It will be necessary to check how it all works.

Good point, I didn't think about older distros that come with older version of libpaper. In view of that, the current patch is probably a safer approach.

> > How about to change char *paperName to const char *paperName instead? > > It will be necessary to check how it all works. Good point, I didn't think about older distros that come with older version of libpaper. In view of that, the current patch is probably a safer approach.
Owner

Good point, I didn't think about older distros that come with older version of libpaper. In view of that, the current patch is probably a safer approach.

Sorry, ignore my previous comment. Clearly my brain wasn't working!
If we change paperName from char* to const char*, it would work with both old and new version of systempapername()

> Good point, I didn't think about older distros that come with older version of libpaper. In view of that, the current patch is probably a safer approach. Sorry, ignore my previous comment. Clearly my brain wasn't working! If we change `paperName` from `char*` to `const char*`, it would work with both old and new version of `systempapername()`
ormorph force-pushed feat/libpaper from 4e323581ac to 2b9cf56a72 1 year ago
ormorph commented 1 year ago
Poster
Collaborator

If we change paperName from char* to const char*, it would work with both old and new version of systempapername()

Yes it works. I did not pay attention that this variable is needed only for paperinfo, of course it will work in all assembly options. Correction added.

> If we change paperName from char* to const char*, it would work with both old and new version of systempapername() Yes it works. I did not pay attention that this variable is needed only for `paperinfo`, of course it will work in all assembly options. Correction added.
MicheleC approved these changes 1 year ago
MicheleC left a comment
Owner

Looks good

Looks good
MicheleC merged commit 2b9cf56a72 into master 1 year ago
MicheleC deleted branch feat/libpaper 1 year ago
MicheleC added this to the R14.1.0 release milestone 1 year ago

Reviewers

MicheleC approved these changes 1 year ago
The pull request has been merged as 2b9cf56a72.
Sign in to join this conversation.
No reviewers
No Milestone
No Assignees
3 Participants
Notifications
Due Date

No due date set.

Dependencies

No dependencies set.

Reference: TDE/koffice#30
Loading…
There is no content yet.