Permalink
Browse files

Major blitz on unused variables.

1 parent 11e35d5 commit 6d2992b396e3c1972df1df11b06ab292c4a7edac @jtappin jtappin committed Feb 1, 2013
View
@@ -36,7 +36,10 @@ set(CMAKE_INSTALL_LIBDIR lib)
# Uncomment this to debug or use "cmake -D CMAKE_BUILD_TYPE=debug .."
# set(CMAKE_BUILD_TYPE debug)
-# set(CMAKE_BUILD_TYPE release)
+if (NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE release)
+endif()
+message(STATUS "Build type is: ${CMAKE_BUILD_TYPE}")
set(CMAKE_Fortran_FLAGS_DEBUG
"-g -pthread -Wall -Wtabs -fcheck-array-temporaries -fbacktrace -fbounds-check -ffpe-trap=invalid,zero,overflow -Wno-unused-dummy-argument")
View
@@ -89,7 +89,7 @@ function expose_event (widget, event, gdata) result(ret) bind(c)
implicit none
integer(c_int) :: ret
type(c_ptr), value :: widget, event, gdata
- type(c_ptr) :: my_cairo_surface, my_cairo_context, my_pixbuf
+ type(c_ptr) :: my_cairo_context, my_pixbuf
character(kind=c_char), dimension(:), pointer :: pixel
integer :: j
integer(kind=c_int) :: i, nch, rowstride, width, height
@@ -273,7 +273,6 @@ program gtkFortran
use handlers
use my_widgets
implicit none
- integer(1) :: i
call gtk_init ()
@@ -122,7 +122,7 @@ program hl_assistant
use as_handlers
implicit none
- type(c_ptr) :: page, junk, jb, algn, ebox, pbar
+ type(c_ptr) :: junk, jb, algn, ebox, pbar
call gtk_init()
View
@@ -84,6 +84,7 @@ function button_event_h(widget, event, gdata) result(rv) bind(c)
integer(kind=c_int) :: xp1, yp1, xo, yo, xs, ys, ipick
character(len=120), dimension(:), allocatable :: files
+ rv = FALSE
if (c_associated(event)) then
call c_f_pointer(event,bevent)
else
@@ -135,7 +136,6 @@ function button_event_h(widget, event, gdata) result(rv) bind(c)
end if
end if
print *
- rv = FALSE
end function button_event_h
function motion_event_h(widget, event, gdata) bind(c) result(rv)
@@ -203,7 +203,6 @@ function key_event_h(widget, event, gdata) bind(c) result(rv)
type(gdkeventkey), pointer :: bevent
integer(kind=c_int) :: key_q
- type(c_ptr) :: keystr
character(len=20) :: keyname
key_q = gdk_keyval_from_name("q"//c_null_char)
@@ -225,7 +224,7 @@ subroutine draw_pattern(widget)
real(kind=c_double), parameter :: pi = 3.14159265358979323846_c_double
- type(c_ptr) :: my_cairo_context, pixbuf
+ type(c_ptr) :: my_cairo_context
integer :: cstatus
integer :: t
@@ -75,7 +75,7 @@ subroutine show_time(area, dat)
type(c_ptr), intent(in) :: area
integer, intent(in), dimension(:) :: dat
- type(c_ptr) :: cr, pixbuf
+ type(c_ptr) :: cr
character(len=3) :: sdate
character(len=4), parameter, dimension(12) :: mnames = &
View
@@ -168,8 +168,7 @@ subroutine save_file_as(widget, gdata) bind(c)
character(len=120), dimension(:), allocatable :: chfile
character(len=20), dimension(2) :: filters
character(len=30), dimension(2) :: filtnames
- character(len=200) :: inln
- integer :: ios, i
+ integer :: i
character(len=200), dimension(:), allocatable :: text
integer :: idxs
View
@@ -77,7 +77,6 @@ subroutine list_select(list, gdata) bind(c)
end subroutine list_select
subroutine text_cr(widget, gdata) bind(c)
- integer(kind=c_int) :: res
type(c_ptr), value :: widget, gdata
integer, pointer :: fdata
View
@@ -53,7 +53,6 @@ end subroutine my_destroy
subroutine list_select(list, gdata) bind(c)
type(c_ptr), value :: list, gdata
- integer, pointer :: fdata
integer(kind=c_int) :: nsel
integer(kind=c_int), dimension(:), allocatable :: selections
integer(kind=c_int) :: n, n3
@@ -170,7 +169,6 @@ program list_n
character(len=35) :: line
integer(kind=c_int) :: i, ltr
- integer, target :: iappend=0, idel=0
integer(kind=type_kind), dimension(8) :: ctypes
character(len=20), dimension(8) :: titles
integer(kind=c_int), dimension(8) :: sortable, editable
@@ -54,7 +54,6 @@ end subroutine my_destroy
subroutine list_select(list, gdata) bind(c)
type(c_ptr), value :: list, gdata
- integer, pointer :: fdata
integer(kind=c_int) :: nsel
integer(kind=c_int), dimension(:), allocatable :: selections
real(kind=c_double) :: x, x3
@@ -169,7 +168,6 @@ subroutine cell_clicked(renderer, path, gdata) bind(c)
character(len=200) :: fpath
integer(kind=c_int) :: irow
integer(kind=c_int), pointer :: icol
- integer :: ios
type(c_ptr) :: pcol, list
logical :: state
@@ -207,7 +205,6 @@ subroutine rcell_clicked(renderer, path, gdata) bind(c)
character(len=200) :: fpath
integer(kind=c_int) :: irow
integer(kind=c_int), pointer :: icol
- integer :: ios
integer(kind=c_int) :: i
type(c_ptr) :: pcol, list
logical :: state
@@ -274,7 +271,6 @@ program list_rend
integer, parameter :: ncols = 11, nrows=10
character(len=35) :: line
integer(kind=c_int) :: i, ltr
- integer, target :: iappend=0, idel=0
integer(kind=type_kind), dimension(ncols) :: ctypes
character(len=20), dimension(ncols) :: titles, renderers
integer(kind=c_int), dimension(ncols) :: editable
View
@@ -68,9 +68,8 @@ program progress
implicit none
- integer :: t0, t1, i
+ integer :: i
integer(kind=c_int) :: istep, itmax
- real(kind=c_double) :: bval
! Initialize gtk & create a window for the heirarchy
call gtk_init()
View
@@ -78,7 +78,6 @@ program radio
integer :: i
integer(kind=c_int), dimension(6), target :: isel=[ (i-1,i=1,6) ]
character(len=10) :: label
- logical :: changed
! Initialize GTK+
call gtk_init()
View
@@ -59,7 +59,7 @@ subroutine slider2(widget, gdata) bind(c)
integer(kind=c_int) :: ival
- ival = hl_gtk_slider_get_value(widget)
+ ival = nint(hl_gtk_slider_get_value(widget), c_int)
print *, 'INT slider moved to', ival
call hl_gtk_spin_button_set_value(ispin, ival)
end subroutine slider2
@@ -82,7 +82,7 @@ subroutine spinner2(widget, gdata) bind(c)
integer(kind=c_int) :: ival
- ival = hl_gtk_spin_button_get_value(widget)
+ ival = nint(hl_gtk_spin_button_get_value(widget), c_int)
print *, 'INT spinner moved to', ival
call hl_gtk_slider_set_value(islid, ival)
end subroutine spinner2
@@ -100,7 +100,6 @@ function expose_event (widget, event, gdata) result(ret) bind(c)
integer(c_int) :: ret
type(c_ptr), value, intent(in) :: widget, event, gdata
type(c_ptr) :: my_cairo_context
- integer(c_int) :: cstatus
my_cairo_context = gdk_cairo_create (gtk_widget_get_window(widget))
call gdk_cairo_set_source_pixbuf(my_cairo_context, my_pixbuf, 0d0, 0d0)
@@ -278,9 +277,8 @@ program julia
type(c_ptr) :: my_window, table, button1, button2, button3, box1
type(c_ptr) :: label1, label2, label3, label4
type(c_ptr) :: toggle1, expander, notebook, notebookLabel1, notebookLabel2
- type(c_ptr) :: handle1, linkButton
+ type(c_ptr) :: linkButton
integer(c_int) :: message_id, firstTab, secondTab
- integer :: i
call gtk_init ()
View
@@ -62,7 +62,7 @@ program mandelbrot
use iso_c_binding, only: c_ptr, c_null_char, c_null_ptr, c_funloc
use handlers
implicit none
- type(c_ptr) :: my_window, my_button, my_gdk_image, my_gtk_image, style, gc, white_gc
+ type(c_ptr) :: my_window, my_gdk_image, my_gtk_image
call gtk_init ()
@@ -112,8 +112,6 @@ subroutine Mandelbrot_set(the_gdk_image, the_gtk_image, width, height, xmin, xma
real(8) :: x, y, xmin, xmax, ymin, ymax ! coordinates in the complex plane
complex(8) :: c, z
real(8) :: scx, scy ! scales
- real(8) :: t0, t1, st0, st1 ! times for benchmarking
- real(8) :: system_time ! Function
integer(1) :: red, green, blue ! rgb color
scx = ((xmax-xmin)/width) ! x scale
@@ -263,7 +263,7 @@ subroutine mandelbrot_set(my_drawing_area, itermax)
type(c_ptr), intent(in) :: my_drawing_area
integer(kind=c_int), intent(in) :: itermax
- integer(kind=c_int) :: i, j, k, p
+ integer(kind=c_int) :: i, j, k
real(kind=c_double) :: x, y ! coordinates in the complex plane
complex(kind=c_double) :: c, z
integer(kind=c_int8_t) :: red, green, blue ! rgb color
View
@@ -190,9 +190,6 @@ program notebook_example
character(kind=c_char,len=12) :: istr
integer(c_int) :: nb
- character(kind=c_char), dimension(:), pointer :: textptr
- character(len=512) :: my_string
-
! GTK initialisation
call gtk_init ()
View
@@ -61,7 +61,6 @@ subroutine x30f95(area)
type(c_ptr) :: cc
- character(len=80) :: version
character(len=20) :: geometry
integer, dimension(4) :: red, green, blue
View
@@ -237,7 +237,6 @@ function hl_gdk_pixbuf_new_data8g(data) result(pixbuf)
!-
integer(kind=c_int), dimension(2) :: sz
- integer(kind=c_int) :: alpha
sz = shape(data)
@@ -301,7 +300,6 @@ function hl_gdk_pixbuf_new_data16g(data) result(pixbuf)
!-
integer(kind=c_int), dimension(2) :: sz
- integer(kind=c_int) :: alpha
sz = shape(data)
@@ -537,7 +535,7 @@ subroutine hl_gdk_pixbuf_set_pixels8g(pixbuf, pixels, xoff, yoff)
! smaller input array or array slice than the pixbuf size.
!-
- integer :: i,j, ioff, iroff, xstart, ystart, xtop, ytop, lput
+ integer :: i,j, ioff, iroff, xstart, ystart, xtop, ytop
integer(kind=c_int) :: rowstr, nrows, ncols, nchans
integer :: lpix
type(c_ptr), target :: cpixels
@@ -738,7 +736,7 @@ subroutine hl_gdk_pixbuf_set_pixels16g(pixbuf, pixels, xoff, yoff)
! smaller input array or array slice than the pixbuf size.
!-
- integer :: i,j, ioff, iroff, xstart, ystart, xtop, ytop, lput
+ integer :: i,j, ioff, iroff, xstart, ystart, xtop, ytop
integer(kind=c_int) :: rowstr, nrows, ncols, nchans
integer :: lpix
type(c_ptr), target :: cpixels
View
@@ -548,9 +548,12 @@ function hl_gtk_drawing_area_get_gdk_pixbuf(area, x0, y0, xsize, ysize) &
! (defaults, from the origin to the top right of the surface).
!-
- type(c_ptr) :: surface, data, pdata
- integer(kind=c_int) :: nx, ny, rs, rsp, fmt, has_alpha, lpix
+ type(c_ptr) :: surface
+ integer(kind=c_int) :: nx, ny, rs, fmt, lpix
integer(kind=c_int) :: xorig, yorig, xrange, yrange
+
+!!$GTK< 3.0! type(c_ptr) :: data, pdata
+!!$GTK< 3.0! integer(kind=c_int) :: has_alpha, rsp
!!$GTK< 3.0! integer :: lppix, nbp
!!$GTK< 3.0! character(kind=c_char, len=1), dimension(:), pointer :: chdata, swdata
!!$GTK< 3.0! integer :: i,j,n,m
@@ -718,6 +721,8 @@ function hl_gtk_drawing_area_expose_cb(area, event, data) bind(c) &
type(c_ptr) :: cr, isurface
+ rv = FALSE
+
isurface = g_object_get_data(area, "backing-surface")
if (.not. c_associated(isurface)) then
write(error_unit,*) &
@@ -732,7 +737,6 @@ function hl_gtk_drawing_area_expose_cb(area, event, data) bind(c) &
call cairo_set_source_surface(cr, isurface, 0._c_double, 0._c_double)
call cairo_paint(cr)
call cairo_destroy(cr)
- rv = FALSE
end function hl_gtk_drawing_area_expose_cb
!+
@@ -764,7 +768,7 @@ subroutine hl_gtk_drawing_area_resize_cb(area, data) bind(c)
! DATA: c_ptr: required: User data for the callback (not used)
!-
- call hl_gtk_drawing_area_resize(area, copy=.true., wait=.false.)
+ call hl_gtk_drawing_area_resize(area, copy=.true.)
end subroutine hl_gtk_drawing_area_resize_cb
!+
@@ -782,9 +786,6 @@ function hl_gtk_drawing_area_cairo_new(area) result(cr)
!-
type(c_ptr) :: isurface
- integer(kind=c_int) :: width, height, n_channels
- type(c_ptr) :: surface
- integer(kind=c_int) :: ok, cairo_type
isurface = g_object_get_data(area, "backing-surface")
if (.not. c_associated(isurface)) then
@@ -816,7 +817,6 @@ subroutine hl_gtk_drawing_area_cairo_destroy(cr, destroy_surface)
! use gtk_widget_queue_draw to do that.
!-
- integer(kind=c_int) :: width, height
type(c_ptr) :: isurface
if (present(destroy_surface)) then
@@ -832,10 +832,10 @@ subroutine hl_gtk_drawing_area_cairo_destroy(cr, destroy_surface)
end subroutine hl_gtk_drawing_area_cairo_destroy
!+
- subroutine hl_gtk_drawing_area_resize(area, size, copy, wait)
+ subroutine hl_gtk_drawing_area_resize(area, size, copy)
type(c_ptr), intent(in) :: area
integer(kind=c_int), intent(in), optional, dimension(2) :: size
- logical, optional, intent(in) :: copy, wait
+ logical, optional, intent(in) :: copy
! Resize a drawing area and its backing store.
!
@@ -845,27 +845,19 @@ subroutine hl_gtk_drawing_area_resize(area, size, copy, wait)
! after resizing the containing window).
! COPY: logical: optional: Set to .true. to copy the surface
! contents to the new backing store.
- ! WAIT: logical: optional: If present and .false. then do not wait for
- ! all resulting events to complete before returning.
!-
type(c_ptr) :: cback, cback_old, cr, gdk_w
- integer(kind=c_int) :: szx, szy, s_type, bv
+ integer(kind=c_int) :: szx, szy, s_type
type(gtkallocation), target:: alloc
- logical :: copy_surface, sync
+ logical :: copy_surface
if (present(copy)) then
copy_surface = copy
else
copy_surface = .false.
end if
- if (present(wait)) then
- sync = wait
- else
- sync = .true.
- end if
-
! If the SIZE keyword is present then resize the window
if (present(size)) then
call gtk_widget_set_size_request(area, size(1), size(2))
@@ -905,13 +897,6 @@ subroutine hl_gtk_drawing_area_resize(area, size, copy, wait)
call cairo_surface_destroy(cback_old)
end do
- if (sync) then
- do
- if (.not. c_f_logical(gtk_events_pending())) exit
- bv = gtk_main_iteration_do(FALSE)
- end do
- end if
-
end subroutine hl_gtk_drawing_area_resize
!+
Oops, something went wrong.

0 comments on commit 6d2992b

Please sign in to comment.