more [[gnu::...]] attributes
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2018 Max Kellermann <max.kellermann@gmail.com>
|
||||
* Copyright 2016-2021 Max Kellermann <max.kellermann@gmail.com>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -31,7 +31,6 @@
|
||||
#define CURL_EASY_HXX
|
||||
|
||||
#include "String.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <curl/curl.h>
|
||||
|
||||
@@ -199,7 +198,7 @@ public:
|
||||
/**
|
||||
* Returns the response body's size, or -1 if that is unknown.
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
int64_t GetContentLength() const noexcept {
|
||||
double value;
|
||||
return GetInfo(CURLINFO_CONTENT_LENGTH_DOWNLOAD, &value)
|
||||
|
@@ -31,6 +31,7 @@
|
||||
#include "Request.hxx"
|
||||
#include "event/Loop.hxx"
|
||||
#include "event/SocketEvent.hxx"
|
||||
#include "util/Compiler.h"
|
||||
|
||||
#include <cassert>
|
||||
|
||||
@@ -84,7 +85,7 @@ private:
|
||||
(flags & SocketEvent::ERROR ? CURL_CSELECT_ERR : 0);
|
||||
}
|
||||
|
||||
gcc_const
|
||||
[[gnu::const]]
|
||||
static unsigned CurlPollToFlags(int action) noexcept {
|
||||
switch (action) {
|
||||
case CURL_POLL_NONE:
|
||||
@@ -172,7 +173,7 @@ CurlGlobal::Remove(CurlRequest &r) noexcept
|
||||
/**
|
||||
* Find a request by its CURL "easy" handle.
|
||||
*/
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
static CurlRequest *
|
||||
ToRequest(CURL *easy) noexcept
|
||||
{
|
||||
|
@@ -172,7 +172,7 @@ CurlRequest::Done(CURLcode result) noexcept
|
||||
}
|
||||
}
|
||||
|
||||
gcc_pure
|
||||
[[gnu::pure]]
|
||||
static bool
|
||||
IsResponseBoundaryHeader(StringView s) noexcept
|
||||
{
|
||||
|
@@ -30,9 +30,7 @@
|
||||
#ifndef CURL_VERSION_HXX
|
||||
#define CURL_VERSION_HXX
|
||||
|
||||
#include "util/Compiler.h"
|
||||
|
||||
gcc_const
|
||||
[[gnu::const]]
|
||||
bool
|
||||
IsCurlOlderThan(unsigned version_num) noexcept;
|
||||
|
||||
|
Reference in New Issue
Block a user