Permalink
Browse files

fix several compile warnings

  • Loading branch information...
1 parent a11eb98 commit 7bc470396463700a59d585bdbc34dd556d8b5068 @chobie committed Aug 10, 2012
Showing with 69 additions and 79 deletions.
  1. +4 −4 php_sundown.c
  2. +1 −1 php_sundown.h
  3. +2 −2 render_base.c
  4. +26 −26 render_html.c
  5. +16 −16 render_html_toc.c
  6. +20 −30 sundown_markdown.c
View
@@ -60,7 +60,7 @@ static void sundown__render(SundownRendererType render_type, INTERNAL_FUNCTION_P
buffer_len = strlen(buffer);
memset(&input_buf, 0x0, sizeof(struct buf));
- input_buf.data = buffer;
+ input_buf.data = (uint8_t *)buffer;
input_buf.size = strlen(buffer);
output_buf = bufnew(128);
@@ -90,11 +90,11 @@ static void sundown__render(SundownRendererType render_type, INTERNAL_FUNCTION_P
if (Z_BVAL_P(zend_read_property(sundown_class_entry, getThis(),"enable_pants",sizeof("enable_pants")-1, 0 TSRMLS_CC))) {
struct buf *smart_buf = bufnew(128);
- sdhtml_smartypants(smart_buf, output_buf->data,output_buf->size);
- RETVAL_STRINGL(smart_buf->data, smart_buf->size,1);
+ sdhtml_smartypants(smart_buf, output_buf->data, output_buf->size);
+ RETVAL_STRINGL((char*)smart_buf->data, smart_buf->size, 1);
bufrelease(smart_buf);
} else {
- RETVAL_STRINGL(output_buf->data, output_buf->size,1);
+ RETVAL_STRINGL((char*)output_buf->data, output_buf->size, 1);
}
}
View
@@ -170,7 +170,7 @@ static inline zval* buf2str(const struct buf *text)
if (text == NULL || text->size == 0) {
ZVAL_NULL(str);
} else {
- ZVAL_STRINGL(str, text->data, text->size,1);
+ ZVAL_STRINGL(str, (char *)text->data, text->size, 1);
}
return str;
}
View
@@ -574,8 +574,8 @@ PHP_METHOD(sundown_render_base, postprocess)
if (Z_BVAL_P(zend_read_property(Z_OBJCE_P(getThis()), getThis(),"enable_pants",sizeof("enable_pants")-1, 1 TSRMLS_CC))) {
struct buf *smart_buf = bufnew(128);
- sdhtml_smartypants(smart_buf, text,text_len);
- RETVAL_STRINGL(smart_buf->data, smart_buf->size,1);
+ sdhtml_smartypants(smart_buf, (uint8_t *)text, text_len);
+ RETVAL_STRINGL((char*)smart_buf->data, smart_buf->size, 1);
bufrelease(smart_buf);
} else {
RETVAL_STRINGL(text,text_len, 1);
View
@@ -189,7 +189,7 @@ PHP_METHOD(sundown_render_html, blockCode)
html->cb.blockcode(output,lang,input, &base->html);
bufrelease(input);
bufrelease(lang);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -215,7 +215,7 @@ PHP_METHOD(sundown_render_html, blockQuote)
output = bufnew(128);
html->cb.blockquote(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -241,7 +241,7 @@ PHP_METHOD(sundown_render_html, blockHtml)
output = bufnew(128);
html->cb.blockhtml(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -268,7 +268,7 @@ PHP_METHOD(sundown_render_html, header)
output = bufnew(128);
html->cb.header(output,input,header_level, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -283,7 +283,7 @@ PHP_METHOD(sundown_render_html, hrule)
output = bufnew(128);
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
html->cb.hrule(output,&html->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
@@ -313,7 +313,7 @@ PHP_METHOD(sundown_render_html, listBox)
if (input != NULL) {
bufrelease(input);
}
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -343,7 +343,7 @@ PHP_METHOD(sundown_render_html, listItem)
bufrelease(input);
}
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -369,7 +369,7 @@ PHP_METHOD(sundown_render_html, paragraph)
output = bufnew(128);
html->cb.paragraph(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -395,7 +395,7 @@ PHP_METHOD(sundown_render_html, table)
b_body = str2buf(body,body_len);
output = bufnew(128);
html->cb.table(output,b_header,b_body,&base->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(b_header);
bufrelease(b_body);
bufrelease(output);
@@ -421,7 +421,7 @@ PHP_METHOD(sundown_render_html, tableRow)
input = str2buf(contents, contents_len);
output = bufnew(128);
html->cb.table_row(output,input,&base->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(input);
bufrelease(output);
}
@@ -448,7 +448,7 @@ PHP_METHOD(sundown_render_html, tableCell)
input = str2buf(content, content_len);
output = bufnew(128);
html->cb.table_cell(output,input,alignment,&base->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(input);
bufrelease(output);
}
@@ -474,7 +474,7 @@ PHP_METHOD(sundown_render_html, autolink)
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
html->cb.autolink(output,m_link,link_type, &html->html);
bufrelease(m_link);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
@@ -499,7 +499,7 @@ PHP_METHOD(sundown_render_html, codespan)
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
html->cb.codespan(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -525,7 +525,7 @@ PHP_METHOD(sundown_render_html, doubleEmphasis)
output = bufnew(128);
html->cb.double_emphasis(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -551,7 +551,7 @@ PHP_METHOD(sundown_render_html, emphasis)
output = bufnew(128);
html->cb.emphasis(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -581,7 +581,7 @@ PHP_METHOD(sundown_render_html, image)
bufrelease(b_link);
bufrelease(b_title);
bufrelease(b_alt_text);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -596,7 +596,7 @@ PHP_METHOD(sundown_render_html, linebreak)
output = bufnew(128);
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
html->cb.linebreak(output,&html->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -624,7 +624,7 @@ PHP_METHOD(sundown_render_html, link)
bufrelease(m_link);
bufrelease(m_title);
bufrelease(m_content);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -648,7 +648,7 @@ PHP_METHOD(sundown_render_html, rawHtml)
html = (php_sundown_render_html_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
html->cb.raw_html_tag(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -672,7 +672,7 @@ PHP_METHOD(sundown_render_html, tripleEmphasis)
output = bufnew(128);
html->cb.triple_emphasis(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -696,7 +696,7 @@ PHP_METHOD(sundown_render_html, strikethrough)
output = bufnew(128);
html->cb.strikethrough(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -720,7 +720,7 @@ PHP_METHOD(sundown_render_html, superscript)
output = bufnew(128);
html->cb.superscript(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -743,12 +743,12 @@ PHP_METHOD(sundown_render_html, entity)
if (html->cb.entity) {
input = str2buf(text, text_len);
output = bufnew(128);
- html->cb.entity(output,input, &html->html);
+ html->cb.entity(output, input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
} else {
- RETVAL_STRINGL(text,text_len, 1);
+ RETVAL_STRINGL((char *)text, text_len, 1);
}
}
/* }}} */
@@ -772,7 +772,7 @@ PHP_METHOD(sundown_render_html, normalText)
output = bufnew(128);
html->cb.normal_text(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
View
@@ -213,10 +213,10 @@ PHP_METHOD(sundown_render_html_toc, header)
html = (php_sundown_render_html_toc_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
base = (php_sundown_render_base_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
input = str2buf(htext, htext_len);
- output = bufnew(128);
- html->cb.header(output,input,header_level, &base->html);
+ output = bufnew(128);
+ html->cb.header(output, input, header_level, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -302,9 +302,9 @@ PHP_METHOD(sundown_render_html_toc, codespan)
input = str2buf(code, code_len);
output = bufnew(128);
html = (php_sundown_render_html_toc_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
- html->cb.codespan(output,input, &html->html);
+ html->cb.codespan(output, input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -329,7 +329,7 @@ PHP_METHOD(sundown_render_html_toc, doubleEmphasis)
output = bufnew(128);
html->cb.double_emphasis(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -355,7 +355,7 @@ PHP_METHOD(sundown_render_html_toc, emphasis)
output = bufnew(128);
html->cb.emphasis(output,input, &base->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -399,7 +399,7 @@ PHP_METHOD(sundown_render_html_toc, link)
bufrelease(m_link);
bufrelease(m_title);
bufrelease(m_content);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -431,7 +431,7 @@ PHP_METHOD(sundown_render_html_toc, tripleEmphasis)
output = bufnew(128);
html->cb.triple_emphasis(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -453,9 +453,9 @@ PHP_METHOD(sundown_render_html_toc, strikethrough)
html = (php_sundown_render_html_toc_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
input = str2buf(text, text_len);
output = bufnew(128);
- html->cb.strikethrough(output,input, &html->html);
+ html->cb.strikethrough(output, input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -479,7 +479,7 @@ PHP_METHOD(sundown_render_html_toc, superscript)
output = bufnew(128);
html->cb.superscript(output,input, &html->html);
bufrelease(input);
- RETVAL_STRINGL(output->data, output->size,1);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
@@ -500,11 +500,11 @@ PHP_METHOD(sundown_render_html_toc, normalText)
int text_len;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
- "s",&text, &text_len) == FAILURE) {
+ "s", &text, &text_len) == FAILURE) {
return;
}
- RETVAL_STRINGL(text,text_len,1);
+ RETVAL_STRINGL(text, text_len, 1);
}
/* }}} */
@@ -525,8 +525,8 @@ PHP_METHOD(sundown_render_html_toc, docFooter)
html = (php_sundown_render_html_toc_t *) zend_object_store_get_object(getThis() TSRMLS_CC);
output = bufnew(128);
- html->cb.doc_footer(output,&html->html);
- RETVAL_STRINGL(output->data, output->size,1);
+ html->cb.doc_footer(output, &html->html);
+ RETVAL_STRINGL((char *)output->data, output->size, 1);
bufrelease(output);
}
/* }}} */
Oops, something went wrong.

0 comments on commit 7bc4703

Please sign in to comment.