fixed conversion issues

This commit is contained in:
Phuntsok Drak-pa 2018-10-31 09:56:44 +01:00
parent 3701a20d22
commit 6c07827b21
4 changed files with 8 additions and 8 deletions

View File

@ -1,6 +1,6 @@
#include <stdio.h>
int main(int argc, char* argv[]) {
printf("Hello World!\n");
return 0;
int main(void) {
printf("Hello World!\n");
return 0;
}

View File

@ -62,11 +62,11 @@ void read_file_format(FILE* fp, char* filename) {
*/
void check_for_comments(FILE* fp) {
char c;
c = getc(fp);
c = (char)getc(fp);
while (c == '#') {
while (getc(fp) != '\n')
;
c = getc(fp);
c = (char)getc(fp);
}
ungetc(c, fp);
}
@ -157,7 +157,7 @@ GLubyte *imageToData(Image_t img) {
Pixel_t pixel;
GLubyte *data, size;
unsigned long i;
size = darraySize(img->pixels);
size = (GLubyte)darraySize(img->pixels);
data = (GLubyte *)malloc(3 * sizeof(GLubyte) * size);
for(i = 0; i < size; i += 3) {
pixel = darrayGet(img->pixels, i / 3);

View File

@ -83,7 +83,7 @@ void deleteImage(Image_t self) {
* \param[in] xg Abscisse extrême gauche du segment
* \return Pointeur sur un conteneur de segment
*/
Segment_t newSegment(uint64_t y, uint64_t xd, uint64_t xg) {
Segment_t newSegment(uint16_t y, uint16_t xd, uint16_t xg) {
Segment_t res;
res = (Segment_t)malloc(sizeof(Segment));
res->y = y;

View File

@ -120,7 +120,7 @@ Image_t newImage();
/// \brief Destructeur dune image
void deleteImage(Image_t self);
/// \brief Constructeur dun segment de couleur unie
Segment_t newSegment(uint64_t y, uint64_t xd, uint64_t xg);
Segment_t newSegment(uint16_t y, uint16_t xd, uint16_t xg);
/// \brief Destructeur dun segment de couleur unie
void deleteSegment(Segment_t self);
/// \brief Constructeur de conteneur de zone