Set up wpiformat

This commit is contained in:
Tyler Veness
2017-10-21 20:31:20 -07:00
committed by Peter Johnson
parent cd4b7b6cc7
commit c6f6b352fb
58 changed files with 1356 additions and 1263 deletions

View File

@@ -1,5 +1,5 @@
/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2016. All Rights Reserved. */
/* Copyright (c) 2016-2017 FIRST. All Rights Reserved. */
/* Open Source Software - may be modified and shared by FRC teams. The code */
/* must be accompanied by the FIRST BSD license file in the root directory of */
/* the project. */
@@ -9,10 +9,10 @@
#include <cctype>
#include "support/Base64.h"
#include "llvm/raw_ostream.h"
#include "llvm/STLExtras.h"
#include "llvm/StringExtras.h"
#include "llvm/raw_ostream.h"
#include "support/Base64.h"
#include "tcpsockets/TCPConnector.h"
namespace wpi {
@@ -59,7 +59,7 @@ llvm::StringRef UnescapeURI(const llvm::Twine& str,
llvm::StringRef EscapeURI(const llvm::Twine& str,
llvm::SmallVectorImpl<char>& buf, bool spacePlus) {
static const char *const hexLut = "0123456789ABCDEF";
static const char* const hexLut = "0123456789ABCDEF";
llvm::SmallString<128> strBuf;
llvm::StringRef strStr = str.toStringRef(strBuf);
@@ -158,11 +158,9 @@ bool FindMultipartBoundary(raw_istream& is, llvm::StringRef boundary,
// Fast-scan for '-'
size_t pos = searchBuf.find('-', searchBuf[0] == '-' ? 1 : 0);
if (pos == llvm::StringRef::npos) {
if (saveBuf)
saveBuf->append(searchBuf.data(), searchBuf.size());
if (saveBuf) saveBuf->append(searchBuf.data(), searchBuf.size());
} else {
if (saveBuf)
saveBuf->append(searchBuf.data(), pos);
if (saveBuf) saveBuf->append(searchBuf.data(), pos);
// move '-' and following to start of buffer (next read will fill)
std::memmove(searchBuf.data(), searchBuf.data() + pos,