blob: 62950cfcecb90c738fbd6b5958cc86d6f7a40402 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
https://gitlab.com/orcus/orcus/-/commit/469aca3c76965b9031947506a15d940cbcd11cdb
From: Tom Stellard <tstellar@redhat.com>
Date: Mon, 16 May 2022 22:12:30 +0000
Subject: [PATCH] Fix error when compiling with clang
csv.cpp:83:29: error: non-constant-expression cannot be narrowed from type 'Py_ssize_t' (aka 'long') to 'std::basic_string_view::size_type' (aka 'unsigned long') in initializer list [-Wc++11-narrowing]
app.read_stream({p, n});
^
csv.cpp:83:29: note: insert an explicit cast to silence this issue
app.read_stream({p, n});
^
static_cast<size_type>( )
1 error generated.
--- a/src/python/csv.cpp
+++ b/src/python/csv.cpp
@@ -80,7 +80,7 @@ PyObject* csv_read(PyObject* /*module*/, PyObject* args, PyObject* kwargs)
Py_ssize_t n = 0;
const char* p = PyUnicode_AsUTF8AndSize(str.get(), &n);
- app.read_stream({p, n});
+ app.read_stream({p, static_cast<std::string_view::size_type>(n)});
return create_document(std::move(doc));
}
GitLab
|