Skip to content

Commit 5c3d4b1

Browse files
committed
don't use ssize_t
1 parent f9f3382 commit 5c3d4b1

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

lib/filesettings.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ class FileWithDetails
6262

6363
std::string updateSize()
6464
{
65-
ssize_t ssize = Path::fileSize(mPath);
65+
long long ssize = Path::fileSize(mPath);
6666
if (ssize < 0)
6767
return "could not stat file '" + mPath + "': (errno: " + std::to_string(errno) + ")";
6868
mSize = ssize;

lib/path.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,7 +440,7 @@ std::string Path::join(const std::string& path1, const std::string& path2) {
440440

441441
# ifdef _WIN64
442442

443-
ssize_t Path::fileSize(const std::string &filePath) {
443+
long long Path::fileSize(const std::string &filePath) {
444444
struct _stati64 buf;
445445
if (_stati64(filePath.c_str(), &buf) < 0) {
446446
return -1;
@@ -450,7 +450,7 @@ ssize_t Path::fileSize(const std::string &filePath) {
450450

451451
# else
452452

453-
ssize_t Path::fileSize(const std::string &filePath) {
453+
long long Path::fileSize(const std::string &filePath) {
454454
struct _stat buf;
455455
if (_stat(filePath.c_str(), &buf) < 0) {
456456
return -1;
@@ -462,7 +462,7 @@ ssize_t Path::fileSize(const std::string &filePath) {
462462

463463
#else
464464

465-
ssize_t Path::fileSize(const std::string &filePath) {
465+
long long Path::fileSize(const std::string &filePath) {
466466
struct stat buf;
467467
if (stat(filePath.c_str(), &buf) < 0) {
468468
return -1;

lib/path.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class CPPCHECKLIB Path {
207207
* @param filePath path to the file, or -1 if the file cannot be accessed
208208
* @return size of file
209209
*/
210-
static ssize_t fileSize(const std::string &filePath);
210+
static long long fileSize(const std::string &filePath);
211211
};
212212

213213
/// @}

0 commit comments

Comments
 (0)