mirror of https://github.com/procxx/kepka.git
				
				
				
			Fix some warnings
This commit is contained in:
		
							parent
							
								
									e2e9b8aefc
								
							
						
					
					
						commit
						9cf55590c0
					
				|  | @ -169,7 +169,7 @@ inline const char *cGUIDStr() { | ||||||
| 	return gGuidStr; | 	return gGuidStr; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| inline const char **cPublicRSAKeys(int &keysCount) { | inline const char **cPublicRSAKeys(size_t &keysCount) { | ||||||
| 	static const char *(keys[]) = {"\
 | 	static const char *(keys[]) = {"\
 | ||||||
| -----BEGIN RSA PUBLIC KEY-----\n\ | -----BEGIN RSA PUBLIC KEY-----\n\ | ||||||
| MIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\n\ | MIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\n\ | ||||||
|  |  | ||||||
|  | @ -587,13 +587,13 @@ using MTPString = MTPBoxed<MTPstring>; | ||||||
| using MTPBytes = MTPBoxed<MTPbytes>; | using MTPBytes = MTPBoxed<MTPbytes>; | ||||||
| 
 | 
 | ||||||
| inline MTPstring MTP_string(const std::string &v) { | inline MTPstring MTP_string(const std::string &v) { | ||||||
| 	return MTPstring(QByteArray(v.data(), v.size())); | 	return MTPstring(QByteArray(v.data(), static_cast<int>(v.size()))); | ||||||
| } | } | ||||||
| inline MTPstring MTP_string(const QString &v) { | inline MTPstring MTP_string(const QString &v) { | ||||||
| 	return MTPstring(v.toUtf8()); | 	return MTPstring(v.toUtf8()); | ||||||
| } | } | ||||||
| inline MTPstring MTP_string(const char *v) { | inline MTPstring MTP_string(const char *v) { | ||||||
| 	return MTPstring(QByteArray(v, strlen(v))); | 	return MTPstring(QByteArray(v, static_cast<int>(strlen(v)))); | ||||||
| } | } | ||||||
| MTPstring MTP_string(const QByteArray &v) = delete; | MTPstring MTP_string(const QByteArray &v) = delete; | ||||||
| 
 | 
 | ||||||
|  | @ -604,7 +604,7 @@ inline MTPbytes MTP_bytes(QByteArray &&v) { | ||||||
| 	return MTPbytes(std::move(v)); | 	return MTPbytes(std::move(v)); | ||||||
| } | } | ||||||
| inline MTPbytes MTP_bytes(base::const_byte_span bytes) { | inline MTPbytes MTP_bytes(base::const_byte_span bytes) { | ||||||
| 	return MTP_bytes(QByteArray(reinterpret_cast<const char *>(bytes.data()), bytes.size())); | 	return MTP_bytes(QByteArray(reinterpret_cast<const char *>(bytes.data()), static_cast<int>(bytes.size()))); | ||||||
| } | } | ||||||
| inline MTPbytes MTP_bytes(const std::vector<gsl::byte> &bytes) { | inline MTPbytes MTP_bytes(const std::vector<gsl::byte> &bytes) { | ||||||
| 	return MTP_bytes(gsl::make_span(bytes)); | 	return MTP_bytes(gsl::make_span(bytes)); | ||||||
|  | @ -714,7 +714,7 @@ struct MTPStringLogger { | ||||||
| 	} | 	} | ||||||
| 
 | 
 | ||||||
| 	MTPStringLogger &add(const char *data, qint32 len = -1) { | 	MTPStringLogger &add(const char *data, qint32 len = -1) { | ||||||
| 		if (len < 0) len = strlen(data); | 		if (len < 0) len = static_cast<qint32>(strlen(data)); | ||||||
| 		if (!len) return (*this); | 		if (!len) return (*this); | ||||||
| 
 | 
 | ||||||
| 		ensureLength(len); | 		ensureLength(len); | ||||||
|  |  | ||||||
|  | @ -53,9 +53,9 @@ private: | ||||||
| }; | }; | ||||||
| 
 | 
 | ||||||
| void DcOptions::readBuiltInPublicKeys() { | void DcOptions::readBuiltInPublicKeys() { | ||||||
| 	auto keysCount = 0; | 	size_t keysCount = 0; | ||||||
| 	auto keys = cPublicRSAKeys(keysCount); | 	auto keys = cPublicRSAKeys(keysCount); | ||||||
| 	for (auto i = 0; i != keysCount; ++i) { | 	for (size_t i = 0; i != keysCount; ++i) { | ||||||
| 		auto keyBytes = gsl::as_bytes(gsl::make_span(keys[i], keys[i] + strlen(keys[i]))); | 		auto keyBytes = gsl::as_bytes(gsl::make_span(keys[i], keys[i] + strlen(keys[i]))); | ||||||
| 		auto key = internal::RSAPublicKey(keyBytes); | 		auto key = internal::RSAPublicKey(keyBytes); | ||||||
| 		if (key.isValid()) { | 		if (key.isValid()) { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue