Revisions
-
cfr revised this gist
May 27, 2011 . 1 changed file with 0 additions and 21 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,21 +0,0 @@ -
cfr revised this gist
Jul 27, 2010 . 2 changed files with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ SOURCES = image_cv.c main.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) CC = gcc CFLAGS = -std=c99 -Wall -Wextra -Werror -pedantic INCLUDE = -I. default: all This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -10,7 +10,7 @@ int main() { struct { char c; } a = {'a'}; printf("access_pixel(img, 0, 1) = %d\n", access_pixel(&a, 0, 0)); return 0; } -
vlasovskikh revised this gist
Jul 11, 2010 . 3 changed files with 4 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,7 +1,7 @@ SOURCES = image_cv.c main.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) CC = gcc CFLAGS = -std=c99 -Wall -Wextra -Werror -pedantic INCLUDE = -I. default: all This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ typedef int Image; Image *make_image(int foo); char access_pixel(Image *img, int r, int c); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,12 +6,12 @@ typedef struct { } IplImage; Image *make_image(int foo) { IplImage *img = (IplImage *) malloc(sizeof(IplImage)); if (!img) return NULL; img->foo = foo; img->bar = foo + 14; return (Image *) img; } char access_pixel(Image *img, int r, int c) { -
vlasovskikh revised this gist
Jul 11, 2010 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,7 +7,10 @@ int main() { fprintf(stderr, "error: querying an image for 42 failed\n"); return 1; } struct { char c; } a = {'a'}; printf("access_pixel(img, 0, 0) = %d\n", access_pixel(&a, 0, 0)); return 0; } -
vlasovskikh revised this gist
Jul 11, 2010 . 5 changed files with 63 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,4 @@ syntax:glob main *.o This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ SOURCES = image_cv.c main.c OBJECTS = $(patsubst %.c,%.o,$(SOURCES)) CC = gcc CFLAGS = -std=c99 -Wall -Wextra -pedantic INCLUDE = -I. default: all all: $(OBJECTS) main main: main.o image_cv.o gcc -o main main.o image_cv.o image_cv.c: image.h %.o: %.c $(CC) -c -o $@ $(CFLAGS) $(INCLUDE) $< clean: rm -f $(OBJECTS) This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,2 +1,5 @@ typedef void Image; Image *make_image(int foo); char access_pixel(Image *img, int r, int c); This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ #include <stdlib.h> #include <image.h> typedef struct { int foo, bar; } IplImage; Image *make_image(int foo) { IplImage *img = (Image *) malloc(sizeof(IplImage)); if (!img) return NULL; img->foo = foo; img->bar = foo + 14; return img; } char access_pixel(Image *img, int r, int c) { IplImage *iplimg = (IplImage *) img; return iplimg->foo + r + c; } This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #include <stdio.h> #include <image.h> int main() { Image *img = make_image(42); if (!img) { fprintf(stderr, "error: querying an image for 42 failed\n"); return 1; } printf("access_pixel(img, 0, 0) = %d\n", access_pixel(img, 0, 0)); return 0; } -
vlasovskikh created this gist
Jul 11, 2010 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,2 @@ typedef Image void; char access_pixel(Image *img, int r, int c);