1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Fixing more warnings (Paul Stoffregen).

This commit is contained in:
David A. Mellis
2011-10-10 11:28:44 -04:00
parent 965480f148
commit ca671fdc05
10 changed files with 19 additions and 18 deletions

View File

@ -18,7 +18,7 @@
uint8_t nfilecount=0;
*/
File::File(SdFile f, char *n) {
File::File(SdFile f, const char *n) {
// oh man you are kidding me, new() doesnt exist? Ok we do it by hand!
_file = (SdFile *)malloc(sizeof(SdFile));
if (_file) {

View File

@ -348,7 +348,7 @@ boolean SDClass::begin(uint8_t csPin) {
// this little helper is used to traverse paths
SdFile SDClass::getParentDir(char *filepath, int *index) {
SdFile SDClass::getParentDir(const char *filepath, int *index) {
// get parent directory
SdFile d1 = root; // start with the mostparent, root!
SdFile d2;
@ -357,7 +357,7 @@ SdFile SDClass::getParentDir(char *filepath, int *index) {
SdFile *parent = &d1;
SdFile *subdir = &d2;
char *origpath = filepath;
const char *origpath = filepath;
while (strchr(filepath, '/')) {
@ -404,7 +404,7 @@ SdFile SDClass::getParentDir(char *filepath, int *index) {
}
File SDClass::open(char *filepath, uint8_t mode) {
File SDClass::open(const char *filepath, uint8_t mode) {
/*
Open the supplied file path for reading or writing.

View File

@ -29,7 +29,7 @@ class File : public Stream {
SdFile *_file; // underlying file pointer
public:
File(SdFile f, char *name); // wraps an underlying SdFile
File(SdFile f, const char *name); // wraps an underlying SdFile
File(void); // 'empty' constructor
~File(void); // destructor
virtual size_t write(uint8_t);
@ -62,7 +62,7 @@ private:
SdFile root;
// my quick&dirty iterator, should be replaced
SdFile getParentDir(char *filepath, int *indx);
SdFile getParentDir(const char *filepath, int *indx);
public:
// This needs to be called to set up the connection to the SD card
// before other methods are used.
@ -71,7 +71,7 @@ public:
// Open the specified file/directory with the supplied mode (e.g. read or
// write, etc). Returns a File object for interacting with the file.
// Note that currently only one file can be open at a time.
File open(char *filename, uint8_t mode = FILE_READ);
File open(const char *filename, uint8_t mode = FILE_READ);
// Methods to determine if the requested file path exists.
boolean exists(char *filepath);

View File

@ -30,10 +30,11 @@
/** Store and print a string in flash memory followed by a CR/LF.*/
#define PgmPrintln(x) SerialPrintln_P(PSTR(x))
/** Defined so doxygen works for function definitions. */
#define NOINLINE __attribute__((noinline))
#define NOINLINE __attribute__((noinline,unused))
#define UNUSEDOK __attribute__((unused))
//------------------------------------------------------------------------------
/** Return the number of bytes currently free in RAM. */
static int FreeRam(void) {
static UNUSEDOK int FreeRam(void) {
extern int __bss_end;
extern int* __brkval;
int free_memory;

View File

@ -23,6 +23,7 @@
#include <avr/io.h>
#include <avr/interrupt.h>
#include <compat/twi.h>
#include "Arduino.h" // for digitalWrite
#ifndef cbi
#define cbi(sfr, bit) (_SFR_BYTE(sfr) &= ~_BV(bit))