Fix -Wshorten-64-to-32 on FreeBSD

Signed-off-by: Azat Khuzhin <a.khuzhin@semrush.com>
This commit is contained in:
Azat Khuzhin 2022-12-10 11:08:40 +01:00
parent bca18298a1
commit 9ed6aa0be1
4 changed files with 5 additions and 5 deletions

View File

@ -153,7 +153,7 @@ restart:
/* Restore old terminal settings and signals. */ /* Restore old terminal settings and signals. */
if (memcmp(&term, &oterm, sizeof(term)) != 0) { if (memcmp(&term, &oterm, sizeof(term)) != 0) {
const int sigttou = signo[SIGTTOU]; const int sigttou = (int)signo[SIGTTOU];
/* Ignore SIGTTOU generated when we are not the fg pgrp. */ /* Ignore SIGTTOU generated when we are not the fg pgrp. */
while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 && while (tcsetattr(input, TCSAFLUSH|TCSASOFT, &oterm) == -1 &&

View File

@ -44,7 +44,7 @@ private:
int fd; int fd;
#endif #endif
#if defined(OS_FREEBSD) #if defined(OS_FREEBSD)
int pagesize; size_t pagesize;
pid_t self; pid_t self;
#endif #endif
}; };

View File

@ -124,12 +124,12 @@ int io_submit(int ctx, long nr, struct iocb * iocbpp[])
} }
} }
return nr; return static_cast<int>(nr);
} }
int io_getevents(int ctx, long, long max_nr, struct kevent * events, struct timespec * timeout) int io_getevents(int ctx, long, long max_nr, struct kevent * events, struct timespec * timeout)
{ {
return kevent(ctx, nullptr, 0, events, max_nr, timeout); return kevent(ctx, nullptr, 0, events, static_cast<int>(max_nr), timeout);
} }

View File

@ -203,7 +203,7 @@ void ClientInfo::setInitialQuery()
void ClientInfo::fillOSUserHostNameAndVersionInfo() void ClientInfo::fillOSUserHostNameAndVersionInfo()
{ {
os_user.resize(256, '\0'); os_user.resize(256, '\0');
if (0 == getlogin_r(os_user.data(), os_user.size() - 1)) if (0 == getlogin_r(os_user.data(), static_cast<int>(os_user.size() - 1)))
os_user.resize(strlen(os_user.c_str())); os_user.resize(strlen(os_user.c_str()));
else else
os_user.clear(); /// Don't mind if we cannot determine user login. os_user.clear(); /// Don't mind if we cannot determine user login.