Skip to content

Commit 21c32ab

Browse files
committed
removements
1 parent 2d50160 commit 21c32ab

File tree

6 files changed

+21
-21
lines changed

6 files changed

+21
-21
lines changed

scripts/build_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
def html(s): htmlFile.write(s+"\n");
7777

7878
def htmlify(d,current):
79-
d = markdown.markdown(d, extensions=['markdown_include.include'])
79+
d = markdown.markdown(d, extensions=['urlize'])
8080
# replace <code> with newlines with pre
8181
idx = d.find("<code>")
8282
end = d.find("</code>", idx)

src/jsdevices.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ int jshGetCharToTransmit(
272272
IOEventFlags device // The device being looked at for a transmission.
273273
) {
274274
if (DEVICE_HAS_DEVICE_STATE(device)) {
275-
JshSerialDeviceState *deviceState = (JshSerialDeviceState*) &jshSerialDeviceStates[TO_SERIAL_DEVICE_STATE(device)];
275+
JshSerialDeviceState *deviceState = &jshSerialDeviceStates[TO_SERIAL_DEVICE_STATE(device)];
276276
if ((*deviceState)&SDS_XOFF_PENDING) {
277277
(*deviceState) = ((*deviceState)&(~SDS_XOFF_PENDING)) | SDS_XOFF_SENT;
278278
return 19/*XOFF*/;
@@ -675,7 +675,7 @@ void jshSetFlowControlXON(IOEventFlags device, bool hostShouldTransmit) {
675675
if (!hostShouldTransmit)
676676
jshSerialFlowControlWasSet = true;
677677
int devIdx = TO_SERIAL_DEVICE_STATE(device);
678-
JshSerialDeviceState *deviceState = (JshSerialDeviceState*) &jshSerialDeviceStates[devIdx];
678+
JshSerialDeviceState *deviceState = &jshSerialDeviceStates[devIdx];
679679
if ((*deviceState) & SDS_FLOW_CONTROL_XON_XOFF) {
680680
if (hostShouldTransmit) {
681681
if (((*deviceState)&(SDS_XOFF_SENT|SDS_XON_PENDING)) == SDS_XOFF_SENT) {
@@ -719,7 +719,7 @@ JsVar *jshGetDeviceObject(IOEventFlags device) {
719719
void jshSetFlowControlEnabled(IOEventFlags device, bool software, Pin pinCTS) {
720720
if (DEVICE_HAS_DEVICE_STATE(device)) {
721721
int devIdx = TO_SERIAL_DEVICE_STATE(device);
722-
JshSerialDeviceState *deviceState = (JshSerialDeviceState*) &jshSerialDeviceStates[devIdx];
722+
JshSerialDeviceState *deviceState = &jshSerialDeviceStates[devIdx];
723723
if (software)
724724
(*deviceState) |= SDS_FLOW_CONTROL_XON_XOFF;
725725
else
@@ -758,7 +758,7 @@ Pin jshGetEventDataPin(IOEventFlags channel) {
758758
void jshSetErrorHandlingEnabled(IOEventFlags device, bool errorHandling) {
759759
if (DEVICE_HAS_DEVICE_STATE(device)) {
760760
int devIdx = TO_SERIAL_DEVICE_STATE(device);
761-
JshSerialDeviceState *deviceState = (JshSerialDeviceState*) &jshSerialDeviceStates[devIdx];
761+
JshSerialDeviceState *deviceState = &jshSerialDeviceStates[devIdx];
762762
if (errorHandling)
763763
(*deviceState) |= SDS_ERROR_HANDLING;
764764
else
@@ -769,7 +769,7 @@ void jshSetErrorHandlingEnabled(IOEventFlags device, bool errorHandling) {
769769
bool jshGetErrorHandlingEnabled(IOEventFlags device) {
770770
if (DEVICE_HAS_DEVICE_STATE(device)) {
771771
int devIdx = TO_SERIAL_DEVICE_STATE(device);
772-
JshSerialDeviceState *deviceState = (JshSerialDeviceState*) &jshSerialDeviceStates[devIdx];
772+
JshSerialDeviceState *deviceState = &jshSerialDeviceStates[devIdx];
773773
return (SDS_ERROR_HANDLING & *deviceState)!=0;
774774
} else
775775
return false;

src/jsflash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -499,8 +499,8 @@ JsVar *jsfReadFile(JsfFileName name, int offset, int length) {
499499
if (offset<0) offset=0;
500500
uint32_t fileLen = jsfGetFileSize(&header);
501501
if (length<=0) length=fileLen;
502-
if ((unsigned) offset>fileLen) offset=fileLen;
503-
if ((unsigned) offset+length>fileLen) length=fileLen-offset;
502+
if (offset>fileLen) offset=fileLen;
503+
if (offset+length>fileLen) length=fileLen-offset;
504504
if (length<=0) return jsvNewFromEmptyString();
505505
// now increment address by offset
506506
addr += offset;
@@ -655,9 +655,9 @@ int jsfLoadFromFlash_readcb(uint32_t *cbdata) {
655655
jsfcbData *data = (jsfcbData*)cbdata;
656656

657657
if (data->address >= data->endAddress) return -1; // at end
658-
if ( (unsigned) data->byteCount==0 || data->bufferCnt>= (unsigned) data->byteCount) {
658+
if (data->byteCount==0 || data->bufferCnt>=data->byteCount) {
659659
data->byteCount = data->endAddress - data->address;
660-
if ( (unsigned) data->byteCount > sizeof(data->buffer))
660+
if (data->byteCount > sizeof(data->buffer))
661661
data->byteCount = sizeof(data->buffer);
662662
jshFlashRead(data->buffer, data->address, data->byteCount);
663663
data->bufferCnt = 0;

src/jsvar.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3865,7 +3865,7 @@ void jsvDefragment() {
38653865
JsVarRef defragVars[DEFRAGVARS];
38663866
memset(defragVars, 0, sizeof(defragVars));
38673867
int defragVarIdx = 0;
3868-
for (unsigned int i=0;i<jsvGetMemoryTotal();i++) {
3868+
for (int i=0;i<jsvGetMemoryTotal();i++) {
38693869
JsVarRef vr = i+1;
38703870
JsVar *v = _jsvGetAddressOf(vr);
38713871
if ((v->flags&JSV_VARTYPEMASK)!=JSV_UNUSED) {
@@ -3895,7 +3895,7 @@ void jsvDefragment() {
38953895
*defragTo = *defragFrom;
38963896
defragFrom->flags = JSV_UNUSED;
38973897
// find references!
3898-
for ( unsigned int i=0;i<jsvGetMemoryTotal();i++) {
3898+
for (int i=0;i<jsvGetMemoryTotal();i++) {
38993899
JsVarRef vr = i+1;
39003900
JsVar *v = _jsvGetAddressOf(vr);
39013901
if ((v->flags&JSV_VARTYPEMASK)!=JSV_UNUSED) {

src/jswrap_espruino.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,7 +1125,7 @@ Show fragmentation.
11251125
*/
11261126
void jswrap_e_dumpFragmentation() {
11271127
int l = 0;
1128-
for ( unsigned i=0;i<jsvGetMemoryTotal();i++) {
1128+
for (int i=0;i<jsvGetMemoryTotal();i++) {
11291129
JsVar *v = _jsvGetAddressOf(i+1);
11301130
if ((v->flags&JSV_VARTYPEMASK)==JSV_UNUSED) {
11311131
jsiConsolePrint(" ");
@@ -1161,7 +1161,7 @@ to visualise where memory is used.
11611161
void jswrap_e_dumpVariables() {
11621162
int l = 0;
11631163
jsiConsolePrintf("ref,size,name,links...\n");
1164-
for ( unsigned i=0;i<jsvGetMemoryTotal();i++) {
1164+
for (int i=0;i<jsvGetMemoryTotal();i++) {
11651165
JsVarRef ref = i+1;
11661166
JsVar *v = _jsvGetAddressOf(ref);
11671167
if ((v->flags&JSV_VARTYPEMASK)==JSV_UNUSED) continue;

src/jswrap_storage.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,14 @@ JsVar *jswrap_storage_open(JsVar *name, JsVar *modeVar) {
353353
char buf[64];
354354
bool foundEnd = false;
355355
while (!foundEnd) {
356-
unsigned int l = STORAGEFILE_CHUNKSIZE-offset;
356+
int l = STORAGEFILE_CHUNKSIZE-offset;
357357
if (l<=0) {
358358
foundEnd = true;
359359
break;
360360
}
361-
if ( l>sizeof(buf)) l=sizeof(buf);
361+
if (l>sizeof(buf)) l=sizeof(buf);
362362
jshFlashRead(buf, addr+offset, l);
363-
for (unsigned int i=0;i<l;i++) {
363+
for (int i=0;i<l;i++) {
364364
if (buf[i]==(char)255) {
365365
l = i;
366366
foundEnd = true;
@@ -480,11 +480,11 @@ JsVar *jswrap_storagefile_read_internal(JsVar *f, int len) {
480480
return result;
481481
}
482482
}
483-
unsigned int l = len;
483+
int l = len;
484484
if (l>sizeof(buf)) l=sizeof(buf);
485-
if (l> (unsigned) remaining) l=remaining;
485+
if (l>remaining) l=remaining;
486486
jshFlashRead(buf, addr+offset, l);
487-
for (unsigned int i=0;i<l;i++) {
487+
for (int i=0;i<l;i++) {
488488
if (buf[i]==(char)255) {
489489
// end of file!
490490
l = i;
@@ -597,7 +597,7 @@ void jswrap_storagefile_write(JsVar *f, JsVar *_data) {
597597
jsvUnLock(data);
598598
return;
599599
}
600-
if (len< (unsigned) remaining) {
600+
if (len<remaining) {
601601
DBG("Write Append Chunk\n");
602602
// Great, it all fits in
603603
jswrap_flash_write(data, addr+offset);

0 commit comments

Comments
 (0)