Skip to content

Commit

Permalink
Merge pull request mappu#123 from arnetheduck/small-fixes
Browse files Browse the repository at this point in the history
Small fixes
  • Loading branch information
mappu authored Jan 11, 2025
2 parents 4c0d782 + 765592c commit 2382949
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
4 changes: 2 additions & 2 deletions cmd/genbindings/emitcabi.go
Original file line number Diff line number Diff line change
Expand Up @@ -376,7 +376,7 @@ func emitAssignCppToCabi(assignExpression string, p CppParameter, rvalue string)
afterCall += indent + "QByteArray " + namePrefix + "_b = " + namePrefix + "_ret->toUtf8();\n"

} else {
shouldReturn = ifv(p.Const, "const ", "") + "QString " + p.ParameterName + "_ret = "
shouldReturn = ifv(p.Const, "const ", "") + "QString " + namePrefix + "_ret = "
afterCall = indent + "// Convert QString from UTF-16 in C++ RAII memory to UTF-8 in manually-managed C memory\n"
afterCall += indent + "QByteArray " + namePrefix + "_b = " + namePrefix + "_ret.toUtf8();\n"
}
Expand All @@ -392,7 +392,7 @@ func emitAssignCppToCabi(assignExpression string, p CppParameter, rvalue string)
// C++ has given us a QByteArray. CABI needs this as a struct miqt_string
// Do not free the data, the caller will free it

shouldReturn = ifv(p.Const, "const ", "") + "QByteArray " + p.ParameterName + "_qb = "
shouldReturn = ifv(p.Const, "const ", "") + "QByteArray " + namePrefix + "_qb = "

afterCall += indent + "struct miqt_string " + namePrefix + "_ms;\n"
afterCall += indent + namePrefix + "_ms.len = " + namePrefix + "_qb.length();\n"
Expand Down
3 changes: 0 additions & 3 deletions libmiqt/libmiqt.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#define MIQT_LIBMIQT_LIBMIQT_H

#include <string.h>
#include <stdlib.h>

#ifdef __cplusplus
extern "C" {
Expand All @@ -25,8 +24,6 @@ struct miqt_map {
void* values;
};

struct miqt_string* miqt_strdup(const char* src, size_t len);

typedef const char const_char;

#ifdef __cplusplus
Expand Down

0 comments on commit 2382949

Please sign in to comment.