瀏覽代碼

Fix compiler warnings

main
PaulStoffregen 9 年之前
父節點
當前提交
238964e9e3
共有 4 個文件被更改,包括 14 次插入13 次删除
  1. +6
    -6
      SD.cpp
  2. +4
    -4
      SD.h
  3. +3
    -2
      utility/Sd2Card.cpp
  4. +1
    -1
      utility/SdFile.cpp

+ 6
- 6
SD.cpp 查看文件

@@ -56,7 +56,7 @@
#define MAX_COMPONENT_LEN 12 // What is max length?
#define PATH_COMPONENT_BUFFER_LEN MAX_COMPONENT_LEN+1

bool getNextPathComponent(char *path, unsigned int *p_offset,
bool getNextPathComponent(const char *path, unsigned int *p_offset,
char *buffer) {
/*

@@ -115,7 +115,7 @@ bool getNextPathComponent(char *path, unsigned int *p_offset,



boolean walkPath(char *filepath, SdFile& parentDir,
boolean walkPath(const char *filepath, SdFile& parentDir,
boolean (*callback)(SdFile& parentDir,
char *filePathComponent,
boolean isLastComponent,
@@ -515,7 +515,7 @@ File SDClass::open(char *filepath, uint8_t mode) {
//}


boolean SDClass::exists(char *filepath) {
boolean SDClass::exists(const char *filepath) {
/*

Returns true if the supplied file path exists.
@@ -536,7 +536,7 @@ boolean SDClass::exists(char *filepath) {
//}


boolean SDClass::mkdir(char *filepath) {
boolean SDClass::mkdir(const char *filepath) {
/*
Makes a single directory or a heirarchy of directories.
@@ -547,7 +547,7 @@ boolean SDClass::mkdir(char *filepath) {
return walkPath(filepath, root, callback_makeDirPath);
}

boolean SDClass::rmdir(char *filepath) {
boolean SDClass::rmdir(const char *filepath) {
/*
Makes a single directory or a heirarchy of directories.
@@ -558,7 +558,7 @@ boolean SDClass::rmdir(char *filepath) {
return walkPath(filepath, root, callback_rmdir);
}

boolean SDClass::remove(char *filepath) {
boolean SDClass::remove(const char *filepath) {
return walkPath(filepath, root, callback_remove);
}


+ 4
- 4
SD.h 查看文件

@@ -74,16 +74,16 @@ public:
File open(const char *filename, uint8_t mode = FILE_READ);

// Methods to determine if the requested file path exists.
boolean exists(char *filepath);
boolean exists(const char *filepath);

// Create the requested directory heirarchy--if intermediate directories
// do not exist they will be created.
boolean mkdir(char *filepath);
boolean mkdir(const char *filepath);
// Delete the file.
boolean remove(char *filepath);
boolean remove(const char *filepath);
boolean rmdir(char *filepath);
boolean rmdir(const char *filepath);

private:


+ 3
- 2
utility/Sd2Card.cpp 查看文件

@@ -142,6 +142,7 @@ static void spiSend(uint8_t b) {
while (!(SPI0_SR & SPI_SR_TCF)) {}
}
/** SPI send multiple bytes */
#if 0
static void spiSend(const uint8_t* output, size_t len) {
// clear any data in RX FIFO
SPI0_MCR = SPI_MCR_MSTR | SPI_MCR_CLR_RXF | SPI_MCR_PCSIS(0x1F);
@@ -175,7 +176,7 @@ static void spiSend(const uint8_t* output, size_t len) {
nf--;
}
}
#endif
@@ -475,7 +476,7 @@ uint8_t Sd2Card::readBlock(uint32_t block, uint8_t* dst) {
*/
uint8_t Sd2Card::readData(uint32_t block,
uint16_t offset, uint16_t count, uint8_t* dst) {
uint16_t n;
//uint16_t n;
if (count == 0) return true;
if ((count + offset) > 512) {
goto fail;

+ 1
- 1
utility/SdFile.cpp 查看文件

@@ -896,7 +896,7 @@ uint8_t SdFile::rmRfStar(void) {
if (!f.remove()) return false;
}
// position to next entry if required
if (curPosition_ != (32*(index + 1))) {
if (curPosition_ != (uint32_t)(32*(index + 1))) {
if (!seekSet(32*(index + 1))) return false;
}
}

Loading…
取消
儲存